whereAll() Query Builder Example In Laravel

  Mar 2024
  ITSolutionsGuides
  Category: Laravel
whereAll() Query Builder Example In Laravel

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,

Let's Start Coding

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.

Subscribe for NewsLetter

Be the first to know about releases and tutorial news and solutions.

We care about your data in our privacy policy.

ITSolutionsGuides

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.

Contact US

ITSolutionsGuides, provide users with an easy-to-use form to reach out for support or inquiries.

whatsapp  gmail  instagram-new--v1  facebook-circled  twitter-circled  linkedin  github  pinterest 

Copyright © 2023 - 2024 All rights reserved | ITSolutionsGuides