Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dadino80's avatar

Eloquent query vs Collections

Hi at all, I am Davide and this is my first post on this FORUM. I am a computer and programming enthusiast and I am working on a project to manage the day off of employees of the Company where I work.

I have a parent calendar component and nested days child components. The parent component retrieve all the day off request from database with an Eloquent query and then it passes the data collection to each child component.

Regarding performance, is it a correct way to operate or is it better that every child retrieve its data by Eloquent query?

Can you indicate me please a web site or youtube channel where can I learn about laravel performance and the ways to improve them?

Thanks in advance for your help and support.

Davide

0 likes
1 reply
jlrdw's avatar

Small amounts of data is fine, but not something like thousands of rows of data.

I for example would let the database do the work if dealing with a large amount of data.

However if retrieving a smaller amount and using a collection to work with it then display it, that is fine.

Please or to participate in this conversation.