Reputation: 153
Regist Controller:
$check = Regist::whereMob($mob)->get();
if($check == emptyArray()){
return back()->with('status', 'input error!!');
}
Here i want to return back if $check gets no input.
It produces (E_ERROR)
Call to undefined function App\Http\Controllers\emptyArray()
How to check this.
Upvotes: 0
Views: 186
Reputation: 1445
This is one of the way to check empty
if ($check->isEmpty()) {...}
or
if (empty($check)) {...}
Upvotes: 1