Answers for "laravel where multiple conditions on single colmn"

PHP
12

laravel where multiple conditions

$query->where([
    ['column_1', '=', 'value_1'],
    ['column_2', '<>', 'value_2'],
    [COLUMN, OPERATOR, VALUE],
    ...
])
Posted by: Guest on May-09-2020
1

laravel where multiple conditions on single colmn

//laravel
// here, i have used two different where condition on a single column
$today = Carbon::today();
$data = Users::where('type',1)
        ->where(function($query) use ($today) {
            return $query->whereDate('updated_at','!=', $today)
            ->orWhere('updated_at',null);
         })
         ->get();
Posted by: Guest on October-09-2020

Code answers related to "laravel where multiple conditions on single colmn"

Browse Popular Code Answers by Language