database/seeders/CategorySeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $faker =  Faker::create();
        foreach(range(1,5) as $index){
            $category = $faker->unique()->name;
            Category::create([
                "name" => $category,
                "slug" => $this->slugify($category),
                "status" => rand(0,1),
            ]);
        }
    }
public function run ( ) { $ faker = Faker :: create ( ) ; foreach ( range ( 1 , 5 ) as $ index ) { $ category = $ faker -> unique ( ) -> name ; Category :: create ( [ " name " => $ category , " slug " => $ this -> slugify ( $ category ) , " status " => rand ( 0 , 1 ) , ] ) ; } }
Run the database seeds.
Run the database seeds .