Laravel eloquent where two conditions
<?php
$query->where([
['column_1', '=', 'value_1'],
['column_2', '<>', 'value_2'],
[COLUMN, OPERATOR, VALUE],
...
])
// here, i have used two different where condition on a single column
$data = Users::where('type',1)
->where(function($query) {
return $query->whereDate('updated_at','!=', Carbon::today())
->orWhere('updated_at',null);
})
->get();
0 comments:
Post a Comment
Thanks