Answer the question
In order to leave comments, you need to log in
How to find matches across all columns in a table?
Good afternoon! Tell me how to find rows by coincidence from any column?
Here is an example
$users = DB::table('users')
->where('votes', '>', 100)
->orWhere('name', 'John')
->get();
Answer the question
In order to leave comments, you need to log in
It is forbidden. And yes, this problem comes up about once in a while.
But you can get the names of all fields with a separate request if you don't want to hardcode them. It's just easier to hardcode.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question