database/seeds/TagTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $tags = ['cibo', 'viaggi', 'sport', 'lavoro', 'cinema'];
        foreach($tags as $tag){
            $newTag = new Tag();
            $newTag->name = $tag;
            $newTag->slug = Str::of($tag)->slug("-");
            $newTag->save();
        }
    }
public function run ( ) { $ tags = [ 'cibo' , 'viaggi' , 'sport' , 'lavoro' , 'cinema' ] ; foreach ( $ tags as $ tag ) { $ newTag = new Tag ( ) ; $ newTag -> name = $ tag ; $ newTag -> slug = Str :: of ( $ tag ) -> slug ( " - " ) ; $ newTag -> save ( ) ; } }
Run the database seeds.
Run the database seeds .