jeudi 29 septembre 2016

Call to undefined function Laravel

I have problem when I'm checking if collection is empty or not, Laravel gives me error

"Call to undefined method Illuminate\Database\Query\Builder::isEmpty()".

Tho it work in other Controller, but when controller is in Sub folder is suddenly stops working.

Here is my code:

$group = UserGroup::where('id', $request->group_id)->first();
    if($group->isEmpty()){ // I get error from here
      return redirect()->back();
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire