Multiple where in search

Hi guys, I’m looking to add one more search condition to the following functionality:

$propiedadesObtenidas = Property::search($request->get('ubicacion'))
        ->where('tipoDePropiedad_id', '=', $tipoPropiedad_id[0])
        ->get();

I would like to add one more condition, similar to:

$propiedadesObtenidas = Property::search($request->get('ubicacion'))
        ->where('tipoDePropiedad_id', '=', $tipoPropiedad_id[0])
        **->where('categoria', '=', $categoria_id)**
        ->get();

it’s possible?

Hello Maraxito2012,

My name is Tom, working at Algolia, please to meet you.

Yes it is totally possible to achieve multiple condition.

What I recommend is to performed the search with the query then to filter.

Here is an example :


$query = (string) request('query');

    $articles = Article::search($query)
        ->get('id')
        ->where('id','>',20)
        ->where('id','<',30);
1 Like