Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mouzak's avatar

join error

Hi this is my first laravel project and I need help. I have two tables, salaries and paie,which I want to join. I also want to set the id value of the employees so that I can have a pay slip for each employee. here is the controller function

public function B_paie() { $bps = DB::table('salaries'); $pai = DB::table('salaries') ->join( 'paie','salaries.id', '=', 'paie.idsalaries') ->select('salaries.', 'paie.') ->get(); return view('bulletin_paie', ['salaries' => $bps],['salaries'=>$pai]);

}
0 likes
1 reply

Please or to participate in this conversation.