dimanche 26 février 2017

Using Factory for seeding pivot table in Laravel5

I have a pivot table named lesson_tag and now I want to seed this table using factory. How I can do this without defining any model for lesson_tag.

This is the way laravel suggests for defining factories:

$factory->define(App\Tag::class, function ($faker) {
   .
   .
   .
}

But as you can see, it needs a model.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire