Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User extends Model {
- public function scopeFiltros($query, $filtros)
- {
- if(isset($filtros['cep']))
- {
- $query->where('cep', '=', $filtros['cep']);
- }
- if(isset($filtros['cidade']))
- {
- $query->where('cidade', '=', $filtros['cidade']);
- }
- if(isset($filtros['estado']))
- {
- $query->where('estado', '=', $filtros['estado']);
- }
- return $query;
- }
- }
- User::filtros($_GET)->all();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement