laravel-views
laravel-views copied to clipboard
Eloquent Eager Loading (with) Supported?
Thanks for the great package.
I am trying to lazy load some of my relationships from the repository method.
public function repository(): Builder
{
return CheckList::with('Equipment')->where('flag_template',1);
}
While I see the query for the Lazy Loading being run i.e
select * from equipments where id in(1,2,3,4,5)
I also see it's recalling the same queries when I need to display the data from the relationships on the UI for each row..
select * from equipments where id = 1,
select * from equipments where id = 2
etc..
Would be great if we can use the relationship data from the Eager loading rather than re-querying the database for them for each row.
Hi @nileshd sorry for the delay, I'll take a look at it