Answer the question
In order to leave comments, you need to log in
How is it possible to make a request to the database in Laravel?
Good afternoon!
Help, I can not understand where to dig.
Here is the code:
$places = Place::whereIn('id', $result)
->where('active', '=', true)
->Join('regions', 'places.region_id', '=', 'regions.id')
->orderBy('rating')
->paginate(10);
Answer the question
In order to leave comments, you need to log in
If you want to get places, then you need to determine what you want to see as a result (select()) and refine the conditions depending on this.
$places = Place::whereIn('places.id', $result)
->where('places.active', '=', true)
->Join('regions', 'places.region_id', '=', 'regions.id')
->orderBy('places.rating')
->select(['places.*'])
->paginate(10);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question