How can I set a variable on the fly in a blade template? I know I can pass it from a controller, but how do I set it up directly in the template on the fly?
@fpendovskiAug 12.2022 — #Although it should be avoided to be done in the blade template, as it shouldn't be the view's concern, you can achieve this by using the @php directive: @php $i = 1 @endphp