Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

laravel 5.2 - função de pesquisa

$users = DB::table('MyTable')
         ->where('id', 'LIKE', '%MySearch%')
         ->or_where('firstname', 'LIKE', '%MySearch%')
         ->or_where('lastname', 'LIKE', '%MySearch%')
         ->or_where('email', 'LIKE', '%MySearch%')
         ->or_where('address', 'LIKE', '%MySearch%');
         ->get();