dimanche 29 septembre 2019

Get search results from database in laravel with LIKE

I have built a search form in a laravel project. Where search is working fine. But the client wants something like if someone searches with terms G51.0, G51.1, G51.2 and so on, then it should also show the row of G51 from the database. But my search result is showing the specific result of G51.0 or G51.1 or G51.2 and so on. I have also used "LIKE" in the controller but no luck. The data in the table is in German language. Here is my controller code...

$search = CsvData::where('k_rperbereich', 'LIKE', "%$request->korperbereich%")->orWhere('diagnose', 'LIKE', "%$request->korperbereich%")->get();
    return view('search-result', compact('search'));


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire