当前位置: 首页>>代码示例>>PHP>>正文


PHP Category::insert方法代码示例

本文整理汇总了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);
 }
开发者ID:Heerou,项目名称:BQMovieStore,代码行数:12,代码来源:CategoryTableSeeder.php

示例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();
    }
开发者ID:kasperbauer,项目名称:kris,代码行数:31,代码来源:DatabaseSeeder.php

示例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']]);
 }
开发者ID:elhaouari,项目名称:FindJobs,代码行数:5,代码来源:DatabaseSeeder.php

示例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);
 }
开发者ID:primitivorm,项目名称:tienda,代码行数:10,代码来源:CategoryTableSeeder.php

示例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);
 }
开发者ID:louisthaihv,项目名称:colong,代码行数:11,代码来源:CategoryTableSeeder.php

示例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);
 }
开发者ID:aquiprefeito,项目名称:aquiprefeito-admin,代码行数:6,代码来源:CategoryTableSeeder.php

示例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);
 }
开发者ID:CodigoCarmesi,项目名称:tienda_juegos,代码行数:10,代码来源:CategoryTableSeeder.php

示例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);
 }
开发者ID:kazamax,项目名称:tienda,代码行数:10,代码来源:CategoryTableSeeder.php


注:本文中的app\Category::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。