Reputation: 794
Right now, I am grabbing users who fit a certain criteria like this:
$searchTerm = 'MULTI';
$multiUser = USER::where('code', 'LIKE', '%'.$searchTerm.'%')->get();
Now I changed the code to be "MANY" but we have a lot of users who already have MULTI as their code so I need the searchTerm to grab both. Can I do this in one query?
Upvotes: 1
Views: 34
Reputation: 1379
User::query()
->where('code', 'LIKE', '%MULTI%')
->orWhere('code', 'LIKE', '%MANY%')
->get();
Upvotes: 1