Hello, the only way in found is to make like this :
$users = User::select('users.firstname', 'users.lastname', 'horaires.jour', 'horaires.start', 'classes.code as code_classe', 'classes.classe', 'cours.code as code_cour', 'cours.cour')
->rightJoin('horaires', function($join) {
$join->on('horaires.user_id', '=', 'users.id');
})
->leftJoin('classes', function($join2) {
$join2->on('horaires.classe_id', '=', 'classes.id');
})
->leftJoin('cours', function($join3) {
$join3->on('horaires.cour_id', '=', 'cours.id');
})
->get();
What is the equivalent with belongsto and other eloquent method ?
Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community