Laravel / Model / Where() and orWhere() condition using model
Where() and orWhere()
-
STEP
1. orWhere() method
to get specific row(s) from a table
2. Syntax
$model_object->orWhere() 3. Parameters
The orWhere() method accepts basically three parameters;
1. The column name 2. The operator(optional) 3. The query value 4. Example
Query
OutputStudent::where('name', '=', 'manoj')->orWhere('age', '>', '10')->get(); select * from students where name='manoj' OR age>'10'