Sorry, so stupid question ..
I use Controller, has a lot of ORM, I want to arrange this code.
my contorller
public function news(Request $request)
{
$history = Recruitments_status::where('recruitments_status.status',1)->get();
$history_a = Recruitments_status::where('recruitments_status.status',2)->get();
$history_b = Recruitments_status::where('recruitments_status.status',3)->get();
$history_c = Recruitments_status::where('recruitments_status.status',4)->get();
$history_d = Recruitments_status::where('recruitments_status.status',5)->get();
$history_e = Recruitments_status::where('recruitments_status.status',6)->get();
return view('pl_sidebar/news',[
'history' => $history,
'history_a' => $history_a,
'history_b' => $history_b,
'history_c' => $history_c,
'history_d' => $history_d,
'history_e' => $history_e
]);
}
How to arrange this ORM code?
Bruce source
share