Level 104
That is an Eloquent query.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I convert this query to Laravel eloquent ?
$search = $request->get('search');
User::where('lastName', 'like', '%'. $search.'%')
->join('stalls', 'users.id', '=', 'stalls.user_id')
->join('locations', 'locations.id', '=', 'stalls.location_id')
->join('activities', 'activities.id', '=', 'stalls.activity_id')
->select('users.name', 'stalls.num_stall', 'locations.name as location', 'activities.nombre as activity')
->paginate();
Please or to participate in this conversation.