mysql relations in Laravel 5.5

Asked

Viewed 24 times

0

I’m trying to model with Laravel a database for purchases, in my mysql relations are like this, so I modeled on Laravel, for the associative table "vendor_detail_item" I used "belongstoMany" relation, it worked using Tinker.

Now comes the problem:

  1. together with the details (supplier’s detail) and the items I would like to be able to access the other tables related to "supplier’s detail" which are "supplier" and "formapagto".

  2. And I would also like to link this associative table "supplier".

I created a template for "vendor_detail_item", but I don’t know exactly how to do this.

I didn’t get to encode anything, I’m just trying to model the same thing on the Laravel.

If you have any suggestions about the MER accepted as well.

Thank you

  • I think it is the case that you create the model of the "pivot table".

  • using the pivot model I can define relation "belongsToMany" with another table? ai I write this relation in the pivot and in the other table? and to refer to more models I have to use the "has-Many-through"?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.