morne
morne

Reputation: 4169

eloquent query on 2 conditions from the same field

In Laravel how do you query a item to be either FALSE or NULL.

return $this->model->where('invisible','=',FALSE)->orWhere('invisible', '=', null)...

Because this that I wrote above, does not seem to do the job

Upvotes: 0

Views: 32

Answers (1)

DevK
DevK

Reputation: 9942

Like this:

$this->model->where(function ($q) {
    $q->where('invisible','=',FALSE)
        ->orWhere('invisible', '=', null);
})...

Parameter grouping

Upvotes: 2

Related Questions