Answer the question
In order to leave comments, you need to log in
How to get related tables?
There is a project in which there are 3 tables in the database, users, a list of sites and a table containing a list of sites associated with users. How to get a list of sites from the user model?
//tables: users, sites, site_user
Answer the question
In order to leave comments, you need to log in
User::find($userId)->sites();
But the links in the models must be spelled out
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question