samedi 4 avril 2020

Request doesn't work when I use filter() in collection Laravel

I am trying to get a filter in a collection, but I get an error:

"code": 500, "error_msg": "Undefined variable: request"

This is my code where I have the error. The request works in any part of the code, but not here...

   $filterKarateka = $karatekasInMarket ->filter(function($item) {           
      return $item->id == $request->id_karateka; 
                    })->first();


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire