Eloquent Laravel Where And Or And

Viewed 1025

I would like to make Sql request like this :

Get the ((Age > 10 AND Weight > 50) OR Name = Jack) AND Actif = 1

My Eloquent request look like this :

$user = DB::table('users')
    ->where('Age', '>=', 10)
    ->where('Weight', '>=', 50)
    ->orWhere('Name', 'Jack')
    ->where('Actif', 1)
    ->get();

But actually it will return the result Jack although this column Actif is set to 0.

1 Answers
Related