You can use the variable inside blade with raw PHP.
@php
echo $variable;
@endphp
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi folks, I have a form that passes page dimensions from a controller to a view and want to be able to perform different logic bases upon those dimensions. Essentially, the view formats the output in 3 columns per page and I need to know when to trigger a new page which is based on the specified page height.
The problem is that vars passed to the view by the controller only seem to be able to be used for HTML output and I cannot use them in PHP logic. I figured that there must be a way to do this in an elegant way. I would appreciate any suggestions you may have. Thanks, Rob
@robtcallahan This code works fine. I have just tested it now.
What doesn't work for you ?
Please or to participate in this conversation.