I use factory and seeder in laravel to insert fake data in my tables with my models to test its efficiency, now I have a pivot table post_tag that has post_id and tag_id, how can I insert fake data in the pivot table.Should I make a model named Post_Tag? I think this way it's not true... Thanks
You should create a model called Post_Tag
. Every model is associated with a table
from your DB. After creating the model you should create the seed file. Of course you could just create the model and insert a new line in your PostSeeder
file but it's nice to have things organized.