Level 60
@php
// php
@endphp
you could use @php blade directive
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using @foreach blade directive and in between I need to perform php functions on the item inside the foreach; how can this be achieved?
Please or to participate in this conversation.