OK. I figured it out by myself.
$subject_list = DB::table('subjects')
->join('users as provider', 'provider.user_id', '=', 'subjects.provider')
->leftjoin('users as replier', 'replier.user_id', '=', 'subjects.replier')
->select('provider.user_name as provider_name', 'replier.user_name as replier_name', 'subjects.*')
->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community