jeudi 14 février 2019

How to seed multiple category data with the help of model in laravel

Category::create(
        ['title' => 'See & do explore','parent_id'=>0],
        ['title' => 'Attractions & Activities','parent_id'=>1],
        ['title' => 'Neighbourhoods','parent_id'=>1],
        ['title' => 'Tours','parent_id'=>1]);

I am trying with this way. When i am running seed command every time first value entered in database.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire