Answers for "like in laravel db"

PHP
5

where like laravel

User::query()
   ->where('name', 'LIKE', "%{$searchTerm}%") 
   ->orWhere('email', 'LIKE', "%{$searchTerm}%") 
   ->get();

reference:
https://freek.dev/1182-searching-models-using-a-where-like-query-in-laravel
Posted by: Guest on December-19-2020
0

laravel 8 db like query

$filterData = DB::table('countries')->where('name','LIKE','%'.$term.'%')
                      ->get();
Posted by: Guest on July-15-2021

Browse Popular Code Answers by Language