当前位置: 首页>>代码示例>>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;未经允许,请勿转载。