Hi!
I was wondering if it's correct to use the @include function inside a @foreach loop in a blade file (performance wise).
For exemple :
<ul>
@foreach
@include('li_element')
@endforeach
</ul>
I do that because I need to add (or update) elements to the list using ajax, and this way I can only render the subview and use it in my ajax response, instead of rendering the complete list.
But when the page load the first time, it has to do this @include a lot of time. Is this a problem?
I was thinking about creating a separate ajax_li_element file and use it to build my ajax response content. But that create one more file and some code duplication.
Thanks.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community