I append to the query - untested but you'll get the idea:
$obj = \Obj::orderBy('created_at','desc');
if($status == 'paid')
{
$obj = $obj->where('status','=','paid');
}elseif($status == 'unpaid')
{
$obj = $obj->where('status','=','unpaid');
}
$obj = $obj->paginate(10);
Ooooh... I really should have thought of that! :-o Thanks!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community