Solved - Laravel where not equal null Value has issue
Jan 12, 2022
Hello Friends,
This article will give you example of laravel where clause not working for null values. I explained simply about laravel eloquent or where is not null. This tutorial will give you simple example of laravel not equal to null code.
In this post, You'll learn where value is not equal to. i will show you use of where null and where not null eloquent query example laravel.
Here i will give you many example for laravel where clause not working for null values.
So let's see bellow solution:
Solution:
Product::select("*")
->where(function ($query) {
$query->where('status', '!=', 1)
->orWhereNull('status')
})
->get();
I hope it will help you...
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial