database/seeders/DefaultCategorySeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $default_categories = [
            'Products',
            'Travel',
            'Gifts',
            'Medicine'
        ];
        foreach ($default_categories as $category_name) {
            DB::table('categories')->insert([
                'name' => $category_name,
            ]);
        }
    }
public function run ( ) { $ default_categories = [ 'Products' , 'Travel' , 'Gifts' , 'Medicine' ] ; foreach ( $ default_categories as $ category_name ) { DB :: table ( 'categories' ) -> insert ( [ 'name' => $ category_name , ] ) ; } }
Run the database seeds.
Run the database seeds .