laravel-theme
laravel-theme copied to clipboard
laravel 5.3 make breadcrumb can't use @foreach
this is an error example when using @foreach on breadcrumb->setTemplate('') : ErrorException in Breadcrumb.php(128) : eval()'d code line 3: Undefined variable: __env
I think it's because there's new variable $__env on loop and eval cant convert it to normal php?
when I echo $parsed before eval(),it return this: addLoop($__currentLoopData); foreach($__currentLoopData as $crumb): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?> popLoop(); $loop = $__env->getFirstLoop(); ?>
when I use @for I can use it normally
@for didn't work for me. I would up changing:
@foreach (...) ... @endforeach
to
<?php foreach(...) { ?> ... <?php } ?> and that fixed it.
@scottlaurent Thanks you so much!