Query to Relationship

Posted 1 month ago by socieboy

I have 2 Models, User and Project... A User has a Project but it can invite other Users to work in this Project... How I do query all my projects, the ones I own and the ones I have been assigned.

User::find(1)->projects()->get();

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.