I have had some strange issues with @php() now avoid it in favour of regular php tags
<?php $cta_url = '/account/pages?signup=' ?>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
@extends("layout")
@section('content')
@livewire('Create')
@filamentScripts
@livewire('notifications')
{{-- @php($cta_url = '/account/pages?signup=') --}}
@endsection
I should be able to write anything I want between the comments tag, however, the above breaks, and took me a really long time to track down the culprit. Known limitation? Or blade bug?
IMAGINE: if you wrote some docblock/comments in your PHP file, and PHP breaks, would you call it a bug?
I'm not interested in discussing the use of @php. Rather, having a @php in comments made the Create component render above the <html> tag, once the comment was removed, the component now renders correctly in the content div
Please or to participate in this conversation.