Support the ongoing development of Laravel.io →
Database Eloquent

Hello,

i am stuck on an eloquent query. I am rewriting an old app based in symfony 1.4 for Laravel 5.1.

My database structure looks like this:

user id name ...

project id description ...

subproject id project_id name ...

art id name ...

project_art id project_id art_id

project_art_user id project_art_id user_id

Project has many subprojects. Subproject belongs to one project. Project has many art. Art belongs to many subprojects. Project has many users which belong to project_art pivot.

How can i access the users that belong to the Project model, but only the users which are in the pivot project_art_user?

I know its seems complicated but i tried to explain it as good as it gets.

Thanks in advance

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.