sage-directives
sage-directives copied to clipboard
@posts should provide Blade's magic $loop variable
trafficstars
It would be great if you could use Blade's magic $loop variable within @posts blocks.
For reference: https://github.com/laravel/framework/blob/7.x/src/Illuminate/View/Concerns/ManagesLoops.php
I need to do this with @repeat as well
Is it possible to show an example of how to use this?
I get Warning : Undefined variable $loop
I am trying to use it like
@posts
@if ($loop->even)
<div id="1">
@else
<div id="2">
@endif
@endposts