How to Get Data Using Where All in Laravel
In this lesson, we will see how to get data using Where All in Laravel, the Where All method is used to retrieve data where all the given columns are like a given value.
How to use Where All in Laravel?
To do that let's assume that we want to get a user whose first name, last name, and surname are LIKE 'sam'.
User::whereAll(['firstname', 'lastname', 'surname'], 'LIKE', 'sam')->get();