class Project{
public function project_users(){
return $this->hasMany(ProjectUser::class);
}
}
class ProjectUser{
public function user(){
return $this->belongsTo(User::class);
}
}
class Project{
public function users(){
return $this->belongsToMany(User::class, 'project_to_user', ....ключи);
}