SELECT * FROM table_name WHERE CONCAT(id,name, address) LIKE \'%same_string%\'
What is an alternate query for this in Laravel
Laravel
Try this.
$field = ['name','id','address']; $name = DB::Table('bookinfo')->Where(function ($query) use($string, $field) { for ($i = 0; $i < count($field); $i++){ $query->orwhere($field, 'like', '%' . $string .'%'); } })->get();