database/seeds/CategoriesTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $categories = collect(['Laravel 7', 'PHP', 'MySQL', 'JavaScript', 'CodeIgniter']);
        $categories->each(function ($c) {
            \App\Category::create([
                'name' => $c,
                'slug' => Str::slug($c)
            ]);
        });
    }
public function run ( ) { $ categories = collect ( [ 'Laravel 7' , 'PHP' , 'MySQL' , 'JavaScript' , 'CodeIgniter' ] ) ; $ categories -> each ( function ( $ c ) { \ App \ Category :: create ( [ 'name' => $ c , 'slug' => Str :: slug ( $ c ) ] ) ; } ) ; }
Run the database seeds.
Run the database seeds .