本文整理汇总了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'));
}
示例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'));
}
示例3: edit
public function edit($id)
{
$deposit = Deposit::find($id);
$users = User::lists('name', 'id');
// dd($user);
return view('admin.depositedit', compact('deposit', 'users'));
}
示例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]);
}
}
示例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)]]);
}
}
示例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())]);
}
}
示例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'));
}
示例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']);
}
}
示例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)]]);
}
}
示例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]);
}
}
示例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)]);
}
}
示例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'));
}
示例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();
}
示例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)]);
}
}
示例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]);
}
}