本文整理汇总了PHP中app\Category::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::insert方法的具体用法?PHP Category::insert怎么用?PHP Category::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Category
的用法示例。
在下文中一共展示了Category::insert方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = array(['name' => 'Batman', 'slug' => 'batman', 'description' => 'Lorem ipsum dolor sit amet, consectetur
adipisicing elit. Tempore, preferendis!', 'color' => '#440022'], ['name' => 'Los vengadores', 'slug' => 'vengadores', 'description' => 'Lorem ipsum dolor sit amet, consectetur
adipisicing elit. Tempore, preferendis!', 'color' => '#445500']);
Category::insert($data);
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$faker = \Faker\Factory::create();
$user = User::create(['name' => 'Christian Kasperbauer', 'email' => 'chris.kasperbauer@gmail.com', 'password' => bcrypt('grütze'), 'phone' => '0176-23152819', 'misc' => 'Friedrich-Ebert-Ring 4
97072 Würzburg
(Ton-)Technik, KRIS, Website!', 'rights' => 'all']);
$user2 = User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]);
for ($i = 0; $i <= 15; $i++) {
User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]);
}
Category::insert([['name' => 'Konzert', 'class' => 'light-green'], ['name' => 'Partey', 'class' => 'funky'], ['name' => 'Theater', 'class' => 'red'], ['name' => 'Kino', 'class' => 'amber'], ['name' => 'Sonstiges', 'class' => 'blue-grey'], ['name' => 'Wort', 'class' => 'light-blue']]);
$user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(4), 'category_id' => rand(1, 6), 'title' => 'Basement Blast', 'subtitle' => 'Geballer im Keller', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'Metal', 'google_event_id' => str_random(12)]));
$user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(9), 'category_id' => rand(1, 6), 'title' => 'Boxbeutel Boombox', 'subtitle' => 'Lecker Weinchen', 'description' => $faker->paragraph(10), 'admission' => 'free', 'genre' => 'Suff', 'google_event_id' => str_random(12)]));
$user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(2)->addMonth(), 'category_id' => rand(1, 6), 'title' => 'Beats & Lyrics', 'subtitle' => 'Freestyle Chypher', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'HipHop', 'google_event_id' => str_random(12)]));
$user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->subDays(2), 'category_id' => rand(1, 6), 'title' => 'Schon vorbei', 'subtitle' => 'Schade, du warst du spät', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12)]));
$user->events()->save(Event::create(['scheduled_at' => Carbon::now()->subMonth(2), 'category_id' => rand(1, 6), 'title' => 'Gelöscht', 'subtitle' => 'Wird niemals stattfinden', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12), 'deleted_at' => Carbon::now()->subDays(7)]));
$events = Event::all();
foreach ($events as $event) {
$event->options()->save(EventOptions::create(['time_start' => '19:00', 'time_end' => '00:00', 'time_meal' => '18:00', 'shifts_bar' => rand(1, 2), 'shifts_tech' => rand(0, 2), 'shifts_door' => rand(0, 1), 'meal_servings' => rand(0, 15), 'misc' => 'Test test test']));
$user_id = rand(1, 2);
$event->shifts()->save(Shift::create(['user_id' => $user_id, 'type' => 'tech']));
$event->shifts()->save(Shift::create(['user_id' => $user_id == 1 ? 2 : 1, 'type' => 'bar']));
}
Model::reguard();
}
示例3: run
public function run()
{
DB::table('categories')->delete();
Category::insert([['name' => 'Technology'], ['name' => 'Healthcare'], ['name' => 'Retail & Sales'], ['name' => 'Food & Restaurant'], ['name' => 'Fashion & Style'], ['name' => 'Construction']]);
}
示例4: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = array(['name' => 'Super heroes', 'slug' => 'super-heroes', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#440022'], ['name' => 'Geek', 'slug' => 'geek', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#445500']);
Category::insert($data);
}
示例5: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Category::truncate();
$data = [["name" => "Tin tức", "type" => 2, "image_url" => "frontend/images/title-news.png"], ["name" => "Hướng dẫn", "type" => 1, "image_url" => "frontend/images/navbar/huong-dan.png"], ["name" => "Đặc trưng", "type" => 1, "image_url" => "frontend/images/navbar/dac-trung.png"], ["name" => "Hoạt động", "type" => 1, "image_url" => "frontend/images/navbar/hoat-dong.png"], ["name" => "Cộng đồng", "type" => 1, "image_url" => "frontend/images/navbar/cong-dong.png"], ["name" => "Clip games", "type" => 3, "image_url" => "frontend/images/images/clip-game.png"], ["name" => "Wall paper", "type" => 3, "image_url" => "frontend/images/images/wallpaper.png"], ["name" => "Screenshot", "type" => 3, "image_url" => "frontend/images/images/screenshot.png"], ["name" => "gift code", "type" => 0, "image_url" => "frontend/images/button/gift-code.png"], ["name" => "the vip", "type" => 0, "image_url" => "frontend/images/button/the-vip.png"], ["name" => "tru thu", "type" => 0, "image_url" => "frontend/images/button/tro-thu.png"], ["name" => "Thu cuuoi", "type" => 0, "image_url" => "frontend/images/button/thu-cuoi.png"], ["name" => "trang bi", "type" => 0, "image_url" => "frontend/images/button/trang-bi.png"]];
Category::insert($data);
}
示例6: run
public function run()
{
DB::table('categories')->delete();
$categories = [['id' => 1, 'name' => 'Pavimentação', 'icon' => 'img/categories/1.png'], ['id' => 2, 'name' => 'Iluminação Pública', 'icon' => 'img/categories/2.png'], ['id' => 3, 'name' => 'Queimada Urbana', 'icon' => 'img/categories/3.png'], ['id' => 4, 'name' => 'Limpeza Urbana', 'icon' => 'img/categories/4.png'], ['id' => 5, 'name' => 'Transporte Público', 'icon' => 'img/categories/5.png'], ['id' => 6, 'name' => 'Sinalização de Trânsito', 'icon' => 'img/categories/6.png']];
Category::insert($categories);
}
示例7: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = array(['name' => 'video juegos', 'slug' => 'video-juego', 'description' => 'Juego de consola', 'color' => '#440022'], ['name' => 'accesorios', 'slug' => 'accesorio', 'description' => 'accesorio para consola', 'color' => '#445500'], ['name' => 'consola de juegos', 'slug' => 'consola-de-juegos', 'description' => 'consola de juegos para el hogar', 'color' => '#446600']);
Category::insert($data);
}
示例8: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$data = array(['name' => 'Quik Silver', 'slug' => 'quik-silver', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#440022'], ['name' => 'Rip Curl', 'slug' => 'rip-curl', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#440022'], ['name' => 'Under Armor', 'slug' => 'under-armor', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#440022'], ['name' => 'Hurley', 'slug' => 'hurley', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, perferendis!', 'color' => '#445500']);
Category::insert($data);
}