Closed marcbelletre closed 8 months ago
https://discourse.roots.io/t/blade-php-endphp-why-is-it-not-working/23713/11 has more context on this.
I understand that not everyone agrees, but this won't be getting changed in Sage's out of the box views unless it were to stop working all together.
Summary
I noticed a bug in Laravel that happens when using a single line
@php
directive followed by a@endphp
tag anywhere in the template file. I created an issue on the laravel/framework repository but I was told it is a know issue for quite a while and there is no plan to fix it.Because the default template files of Sage are using this syntax, it is impossible to use raw PHP inside the loop.
For example this would throw a compilation exception:
I would suggest to update the default template files with the multiline syntax so it doesn't happen. The short syntax is easier to read but at least the full one compiles correctly :)
I also suggested to the Laravel team to add a warning to the docs about this.
Additional context
No response