当前位置: 首页>>代码示例>>PHP>>正文


PHP User::All方法代码示例

本文整理汇总了PHP中app\User::All方法的典型用法代码示例。如果您正苦于以下问题:PHP User::All方法的具体用法?PHP User::All怎么用?PHP User::All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\User的用法示例。


在下文中一共展示了User::All方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Show a list of all the users.
  *
  * @return View
  */
 public function index()
 {
     // Grab all the users
     $users = User::All();
     // Show the page
     return View('admin.users.index', compact('users'));
 }
开发者ID:jeremyreese,项目名称:quotes,代码行数:12,代码来源:UsersController.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = \Faker\Factory::create();
     foreach (range(1, 10) as $index) {
         $user = User::All()->random(1);
         Profile::create(['user_id' => $user->id, 'telephone' => $faker->phoneNumber, 'telegram' => $faker->username]);
     }
 }
开发者ID:dikyarga,项目名称:sistem-informasi-organisasi-dengan-laravel,代码行数:13,代码来源:ProfileTableSeeder.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = \Faker\Factory::create();
     //Posts::truncate();
     foreach (range(1, 10) as $index) {
         $user = User::All()->random(1);
         Posts::create(['author_id' => $user->id, 'title' => $faker->sentence(3), 'body' => $faker->text, 'slug' => $faker->slug(), 'active' => 1]);
     }
 }
开发者ID:dikyarga,项目名称:sistem-informasi-organisasi-dengan-laravel,代码行数:14,代码来源:PostTableSeeder.php

示例4: index

 public function index(User $user)
 {
     if (Auth::user()->role == 'admin') {
         $data['users'] = User::All();
         return view('admin.index', $data);
     } else {
         $data['message'] = 'Вам сюда нельзя!';
         return view('errors.forbidden', $data);
     }
 }
开发者ID:DimaPikash,项目名称:chat,代码行数:10,代码来源:AdminController.php

示例5: getIndex

 /**
  * Show a list of all the users.
  *
  * @return View
  */
 public function getIndex()
 {
     // Grab all the users
     $users = User::All();
     // Do we want to include the deleted users?
     if (Input::get('withTrashed')) {
         $users = User::withTrashed()->get();
     } elseif (Input::get('onlyTrashed')) {
         $users = User::onlyTrashed()->get();
     }
     // Show the page
     return View::make('admin.users.index', compact('users'));
 }
开发者ID:chungyang,项目名称:CSE4701,代码行数:18,代码来源:UsersController.php

示例6: getWinners

 /**
  * Responds to requests to POST
  */
 public function getWinners()
 {
     $winners = User::All()->random(2);
     return view("winner")->with(array('users' => $winners));
     //
 }
开发者ID:seandjones,项目名称:sgf-winner,代码行数:9,代码来源:UserController.php

示例7: getAll

 public function getAll()
 {
     $users = User::All();
     return $users;
 }
开发者ID:sgf-web-devs,项目名称:sgf-winner,代码行数:5,代码来源:UserController.php

示例8: seguidores

 public function seguidores($id)
 {
     $follows = Follow::where('user_id', $id)->get();
     $users = User::All();
     return view('users.seguidores', compact('follows', 'users'));
 }
开发者ID:BQuiroga,项目名称:finalSis,代码行数:6,代码来源:UsersController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::All();
     $test = 'test';
     return view('welcome', ['users' => $users, 'test' => $test]);
 }
开发者ID:jtoshmat,项目名称:jontoshmatov_development,代码行数:11,代码来源:PublicController.php

示例10: create

 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $users = User::All();
     return view('sick/register', ['users' => $users]);
 }
开发者ID:ghermans,项目名称:timecontrol,代码行数:10,代码来源:SickController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $usuarios = User::All();
     return view('user.index', compact('usuarios'));
 }
开发者ID:byrogr,项目名称:admin_mundo_tuerca,代码行数:10,代码来源:UserController.php

示例12: function

| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('index');
});
Route::get('demo', function () {
    return view('test');
});
Route::get('users', function () {
    $users = \App\User::All();
    //select * from users
    return view('userhome')->with('blogger', $users);
});
Route::get('profile/{id}', function ($uid) {
    $user = \App\User::find($uid);
    return view('profile')->with('user', $user);
});
Route::get('blogdetail/{id}', function ($blogid) {
    $blog = \App\Blog::find($blogid);
    return view('blogdetails')->with('blogs', $blog);
});
Route::post('/signup', array('as' => 'signup', 'before' => 'csrf', 'uses' => 'AuthController@userSignup'));
Route::post('/signin', array('as' => 'signin', 'before' => 'csrf', 'uses' => 'AuthController@userSignin'));
Route::get('home', array('as' => 'home', 'before' => 'auth', 'uses' => 'HomeController@getHome'));
Route::get('vehicle', 'Front@vehicle');
开发者ID:anuradhacse,项目名称:UOM-RESOURCE-MANAGER,代码行数:31,代码来源:routes.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::All();
     return view('users', compact('users'));
 }
开发者ID:snowket,项目名称:note-work,代码行数:10,代码来源:UsersController.php


注:本文中的app\User::All方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。