lundi 23 avril 2018

Getting empty array while using %LIKE% in Laravel

I am fetching locations from the database. I have code in the controller like this:

 public function getLocationsList(Request $request,$searchKey)
{
   $searchedLocations = Hotel::where('location', 'LIKE', "%$searchKey%")->get();
   return $searchedLocations;
}

I can't understand $searchedLocations is empty when I have a record in the database.

I am using VueJs and axios to send requests.

enter image description here

Please help.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HRSbrB
via IFTTT

Aucun commentaire:

Enregistrer un commentaire