I am updating a site from Laravel 5.2 to (eventually) 5.7 that was coded by someone else.
Currently I having an issue with this type of code in a blade file:
{{-- */ $hidden = 'hidden' /* --}}
That creates a variable that is used in the file itself like this:
<div class="col-xs-2 {{$hidden}}" id="person1div">
</div>
That seems to work fine in Laravel 5.2 but in 5.3 I get the error message:
Undefined variable: hidden
I could change the code to
<?php $hidden = 'hidden' ?>
but the issue is that there are many variables like this, used in various ways.
Something to note is that these variable are in loops which I guess is why the original developer used them as they get reset and re-populated.
Is there a more correct way to populate the variables?
You can select and replace the syntax like shown below.
You can set variables with values in blade file like this:
and to print the variable on the blade file,