multiple where condition in laravel

Today, We want to share with you multiple where condition in laravel.In this post we will show you multiple orwhere laravel, hear for laravel update query with multiple conditions we will give you demo and example for implement.In this post, we will learn about Laravel 6 Multiple OrWhere With Multiple Parameters with an example.

How to Create Multiple Where Clause Query Using Laravel Eloquent?

Example

$query->where([
    ['column_1', '=', 'value_1'],
    ['column_2', '<>', 'value_2'],
    [COLUMN, OPERATOR, VALUE],
    ...
])

Laravel Multiple Where Condition Example

->where('COLUMN_NAME', 'OPERATOR', 'VALUE')
->where('COLUMN_NAME', 'OPERATOR', 'VALUE')

//OR

->where([
    ['COLUMN_NAME', 'OPERATOR', 'VALUE'],
    ['COLUMN_NAME', 'OPERATOR', 'VALUE']
]);

Example 1:

public function index()
{
    $tamilrokers = Tamilrockers::select('*')
                ->where('status', '=', 1)
                ->where('up_comming', '=', 0)
                ->get();
   
    dd($tamilrokers);
}

Example 2:

public function index()
{
    $tamilrokers = Tamilrockers::select('*')
                ->where([
                    ['status', '=', 1],
                    ['up_comming', '=', 0]
                ])
                ->get();
   
    dd($tamilrokers);
}

I hope you get an idea about find with where condition in laravel.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.