Answers for "where like laravel eloquent and orwhere"

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
8

laravel where like

$users = DB::table('users')
                ->where('name', 'like', 'T%')
                ->get();
Posted by: Guest on May-13-2020

Code answers related to "where like laravel eloquent and orwhere"

Browse Popular Code Answers by Language