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()
    {
        Category::truncate();
        $categories = ['Kaos', 'Gelang', 'Sepatu'];
        foreach ($categories as $category) {
            Category::create(['name' => $category]);
        }
    }
public function run ( ) { Category :: truncate ( ) ; $ categories = [ 'Kaos' , 'Gelang' , 'Sepatu' ] ; foreach ( $ categories as $ category ) { Category :: create ( [ 'name' => $ category ] ) ; } }
Run the database seeds.
Run the database seeds .