Your project_users table, apparently, represents roles in projects, adds another model linked to this table:
project_role { has one user has one role has one project } user { has many project_role ... } project { has many project_role ... }
Then you could do:
$user = ORM::factory('user') ->with('project_role') ->where('project_role.project_id', '=', $id) ->with('project_role:role')->findall();
If this does not work, one of the following should work, but may be another form of workaround for what you need.
$project = ORM::factory('project', $id); $roles = $project->project_role->with('user')->with('role')->findall();
or
$roles = ORM::factory('project_role') ->where('project_id', '=', $id) ->with('user')->with('role')->findall();
source share