skip to Main Content

Combing multiple orWhere() in Laravel 9 Eloquent

Is it possible to combine multiple orWhere() inside one where()? E.g. The following: $query->where(function($query){ $query->where('text1', '=', $_GET['lorem']) ->orWhere('text2', '=', $_GET['lorem']) ->orWhere('text3', '=', $_GET['lorem']) ->orWhere('text4', '=', $_GET['lorem']); }); Would look something like this: $query->where(function($query){ $query->where(['text1' || 'text2' || 'text3' || 'text4'],…

VIEW QUESTION
Back To Top
Search