You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a LazyCollection instance is passed to Blade view and looped via @foreach directive, it causes the query to execute twice. Believe that its because of how foreach directive is compiled under the hood and how count and last record of the Countable is managed inside ManagesLoops file.
@driesvints can it be a feature request? Where Blade compiler pays attention to specifics of LazyCollection and deal it differently than normal Collection?
Description:
When a
LazyCollection
instance is passed to Blade view and looped via@foreach
directive, it causes the query to execute twice. Believe that its because of howforeach
directive is compiled under the hood and howcount
andlast
record of theCountable
is managed inside ManagesLoops file.Steps To Reproduce:
GitHub Repo
https://github.com/awebartisan/lazy-collection-blade-query-bug
The text was updated successfully, but these errors were encountered: