當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::lists方法代碼示例

本文整理匯總了PHP中app\User::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::lists方法的具體用法?PHP User::lists怎麽用?PHP User::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\User的用法示例。


在下文中一共展示了User::lists方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index()
 {
     $views_files_list = $this->viewsFilesList('../resources/views/') + ['another' => trans('ticketit::install.another-file')];
     $inactive_migrations = $this->inactiveMigrations();
     $users_list = User::lists('name', 'id')->toArray();
     return view('ticketit::install.index', compact('views_files_list', 'inactive_migrations', 'users_list'));
 }
開發者ID:darkflamed,項目名稱:ticketit,代碼行數:7,代碼來源:InstallController.php

示例2: edit

 public function edit($id)
 {
     $info = User::findOrFail($id);
     $userLists = User::lists('name', 'id');
     $userRoles = Role::lists('label', 'id');
     return view('user_role.edit', compact('info', 'userLists', 'userRoles'));
 }
開發者ID:shams1978,項目名稱:sadik_project,代碼行數:7,代碼來源:UserRoleController.php

示例3: edit

 public function edit($id)
 {
     $deposit = Deposit::find($id);
     $users = User::lists('name', 'id');
     // dd($user);
     return view('admin.depositedit', compact('deposit', 'users'));
 }
開發者ID:sajal2,項目名稱:Laravel-5-Mess-Application,代碼行數:7,代碼來源:DepositController.php

示例4: run

 public function run()
 {
     $faker = Faker::create();
     $users = User::lists('id');
     foreach (range(1, 50) as $index) {
         Project::create(['user_id' => $faker->randomElement($users), 'name' => $faker->word]);
     }
 }
開發者ID:AaronDhiman,項目名稱:usc-todo,代碼行數:8,代碼來源:ProjectsTableSeeder.php

示例5: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $users = User::lists('id')->all();
     $intelligences = Intelligence::lists('id')->all();
     for ($i = 0; $i <= 200; $i++) {
         factory('App\\Tutorial')->create(['user_id' => $users[array_rand($users)], 'intelligence_id' => $intelligences[array_rand($intelligences)]]);
     }
 }
開發者ID:inteligenicasmultiples,項目名稱:inteligencias,代碼行數:13,代碼來源:TutorialsTableSeeder.php

示例6: run

 public function run()
 {
     $faker = Faker::create();
     $user_ids = User::lists('id');
     foreach (range(1, 10) as $index) {
         Article::create(['title' => $faker->sentence, 'body' => $faker->paragraph(30), 'excerpt' => $faker->paragraph, 'user_id' => $faker->randomElement($user_ids->toArray())]);
     }
 }
開發者ID:SigurdMW,項目名稱:learning-laravel-5,代碼行數:8,代碼來源:ArticlesTableSeeder.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Brand $brand)
 {
     // Edit an exisiting brand
     $statuses = Status::lists('name', 'id');
     $types = Type::whereIn('tablename', ['all', 'brands'])->lists('name', 'id');
     $users = User::lists('name', 'id');
     return view('brands.edit', compact('brand', 'statuses', 'users', 'types'));
 }
開發者ID:kakapa,項目名稱:erpbox,代碼行數:14,代碼來源:BrandsController.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $usersID = User::lists('id')->toArray();
     foreach (range(1, 100) as $index) {
         userData::create(['user_id' => $faker->randomElement($usersID), 'zip' => $faker->postcode, 'profile_picture' => 'https://s3.amazonaws.com/test-laz/default-dp.jpg', 'picture_name' => 'Default Picture']);
     }
 }
開發者ID:Core-Tech-Labs,項目名稱:LAZ,代碼行數:13,代碼來源:UsersDataSeedTables.php

示例9: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $users = User::lists('id')->all();
     $tutorials = Tutorial::lists('id')->all();
     for ($i = 0; $i <= 10000; $i++) {
         factory('App\\Comment')->create(['user_id' => $users[array_rand($users)], 'tutorial_id' => $tutorials[array_rand($tutorials)]]);
     }
 }
開發者ID:inteligenicasmultiples,項目名稱:inteligencias,代碼行數:13,代碼來源:CommentsTableSeeder.php

示例10: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $usersID = User::lists('id')->toArray();
     foreach (range(1, 100) as $index) {
         userData::create(['user_id' => $faker->randomElement($usersID), 'zip' => $faker->postcode]);
     }
 }
開發者ID:Crisfole,項目名稱:LAZ,代碼行數:13,代碼來源:UsersDataSeedTables.php

示例11: run

 public function run()
 {
     $faker = Faker::create();
     $userIds = User::lists('id')->all();
     foreach (range(1, 10) as $index) {
         Order::create(['user_id' => $faker->randomElement($userIds), 'location' => $faker->sentence(), 'delivered_at' => $faker->dateTime(), 'delivery_status' => $faker->numberBetween(0, 10)]);
     }
 }
開發者ID:MinorRoboticsTeam4,項目名稱:Cobot_API,代碼行數:8,代碼來源:DatabaseSeeder.php

示例12: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $pago = pago::findOrfail($id);
     $data1 = User::lists('name', 'id');
     $data2 = DB::table('tipopago')->select('id')->orderBy('id', 'desc')->first()->id;
     $selected = array();
     return view('admin.pago.edit', compact('pago', 'data1', 'data2', 'selected'));
 }
開發者ID:naziio,項目名稱:Crossfitpocurotitulo2,代碼行數:14,代碼來源:PagoController.php

示例13: run

 public function run()
 {
     $faker = $this->beginSeeding(new Todo());
     $userIds = User::lists('id')->toArray();
     foreach (range(1, 100) as $index) {
         Todo::create(['title' => $faker->sentence(), 'user_id' => $faker->randomElement($userIds), 'description' => $faker->randomElement([$faker->paragraph(), null]), 'done' => $faker->randomElement([0, 1])]);
     }
     $this->endSeeding();
 }
開發者ID:valdinei,項目名稱:rest,代碼行數:9,代碼來源:TodosTableSeeder.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $users = User::lists('id')->all();
     $limit = 10;
     for ($i = 0; $i < $limit; $i++) {
         DB::table('follow')->insert(['follower_id' => $faker->randomElement($users), 'follows_id' => $faker->randomElement($users)]);
     }
 }
開發者ID:saahilpingle24,項目名稱:Programming-Assignments,代碼行數:14,代碼來源:FollowTableSeeder.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $users = User::lists('id')->all();
     $limit = 10;
     for ($i = 0; $i < $limit; $i++) {
         DB::table('profiles')->insert(['user_id' => $faker->unique()->randomElement($users), 'username' => $faker->unique()->userName]);
     }
 }
開發者ID:saahilpingle24,項目名稱:Programming-Assignments,代碼行數:14,代碼來源:ProfilesTableSeeder.php


注:本文中的app\User::lists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。