Welcome To ITSolutionsGuides,
The Laravel team released v10.47 which added the added feature of whereAll, Before we will use where and multiple orWhere query builderswhich will take a long set of the line to filter the data from the database as per the requirement. The introduction of the whereAll() query builder made the query simpler. Lets use Laravel's whereAll() query builder method with this comprehensive example. Lets see with the example,
Before we will use where and multiple orWhere query builders to achieve the result. The introduction of the whereAll() query builder made the query simpler. Lets see with the example,
$search = 'test';
User::whereAll([
'first_name',
'last_name',
'email',
], 'LIKE', "%$search%");
/*
SELECT * FROM "users" WHERE (
"first_name" LIKE "%test%"
AND "last_name" LIKE "%test%"
AND "email" LIKE "%test%"
)
*/
We hope it helps everyone. Thanks for supporting ITSolutionsGuides and keep supporting us also follow us in social media platforms.
Be the first to know about releases and tutorial news and solutions.
We care about your data in our privacy policy.
ITSolutionsGuides was started mainly to provide good and quality web solutions for all the developers. We provide tutorials to support all the developers and also we try to provide solutions to the errors we face while coding.
Copyright © 2023 - 2024 All rights reserved | ITSolutionsGuides