I've just started using the framework. In plain PHP after the opening foreach I would then set the variables then close the php tag but then from what I can work out you have to then do the Laravel @foreach tags and then open and close @php. Is there a way around this as it seems like a lot of extra work and code?
@foreach($steps as $row)
@php
$title = $row->title;
$text = $row->text;
$i = 1;
@endphp
<div class="steps-item grid-wrap">
<div class="number"
@if($text || $title)
<div class="text-wrap">
@if($title)
<h2>{{$title}}</h2>
@endif
{!! $text !!}
</div>
@php
$i++;
@endphp
@endif
</div>{{--END steps-item--}}
@endforeach