public function scopeSearch($query, $q) { if (isset($q)) { $ready = regexp_query_ready($q); $query->orWhere('name', 'REGEXP', $ready)->orWhere('real_name', 'REGEXP', $ready)->orWhere('country', 'REGEXP', $ready); } return $query; }
public function scopeGetit($query, $input) { if (isset($input['year']) && !empty($input['year']) && $input['year'] != "all") { $query->where('year', $input['year']); } if (isset($input['genre'])) { $query->where('genre', $input['genre']); } if (isset($input['franch'])) { $query->where('franchises', "LIKE", $input['franch']); } // if(isset($input['title'])) $query->where('title','LIKE','%'.$input['title'].'%'); // if(isset($input['player'])) $query->where('players','LIKE','%'.$input['player'].'%'); if (isset($input['title'])) { $query->where('title', 'REGEXP', regexp_query_ready($input['title'])); } if (isset($input['player'])) { $query->where('players', 'REGEXP', regexp_query_ready($input['player'])); } return $query; }
public function postal_offices_query_info() { $q = \Request::Input('q'); $query = regexp_query_ready($q); // dd($query); $out = \postal_model::where('office', 'REGEXP', $query)->orWhere('city', 'REGEXP', $query)->orWhere('area', 'REGEXP', $query)->orWhere('address', 'REGEXP', $query)->get(); return $out; }