where like laravel 8 code example
Example 1: where like laravel
User::query()
->where('name', 'LIKE', "%{$searchTerm}%")
->orWhere('email', 'LIKE', "%{$searchTerm}%")
->get();
reference:
https:
Example 2: laravel where like
$users = DB::table('users')
->where('name', 'like', 'T%')
->get();
Example 3: where like laravel
$users = DB::table('users')
->where('votes', '>=', 100)
->get();
$users = DB::table('users')
->where('votes', '<>', 100)
->get();
$users = DB::table('users')
->where('name', 'like', 'T%')
->get();