Mysql
 sql >> Database >  >> RDS >> Mysql

laravel 5.2 - funzione di ricerca

$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();