當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。