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

peterstarling's avatar

The reason I am worrying is because loading the same model twice can have an impact on the performance. As @pmall suggested - for formatting data I can use fractal but this does not change the fact that the parent model will be called twice, or in fact multiple times, once for each bid. If the parent model contains multiple mutators loaded by default this might actually affect app performance.

pmall's avatar

loading the same model twice can have an impact on the performance

Stop over-thinking about performance. A good rule about performance is to worry about it when you have actual performance issue. You probably have bigger bottlenecks elsewhere, the difference between running two queries and three queries is negligible.

1 like
Previous

Please or to participate in this conversation.