By using joins, but this is normal way when you want to access Eloquent relationships as properties.
Documentation: https://laravel.com/docs/7.x/queries#joins
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Auction::where('id', $auctionId) ->with(['round','bids','order.entity','order.vehicle.vehicle_make','order.vehicle.vehicle_model','auctionActions']) ->withCount('bids') ->first();
This is my query I would like it to be one single query to the database instead of sending like 9 queries to the database how I can reach that ? thanks in advance
Please or to participate in this conversation.