Using the Blade service container, I want to take a line with markers in it and compile it so that it can be added to the blade server template and further interpolated.
So, I have an email line (short for short) on a server retrieved from a database:
<p>Welcome {{ $first_name }},</p>
And I want it to be interpolated on
<p>Welcome Joe,</p>
Therefore, I can send it to the Blade template in the form of $ content and provide it with all the content and markup, since Blade does not interpolate twice, and now our templates are created by the client and stored in the database.
Blade::compileString(value)creates <p>Welcome <?php echo e($first_name); ?>,</p>, but I can’t figure out how to get $ first_name for a solution Joein a row using the Blade API, and this will not be done in the Blade template later. It simply displays it in a letter as a string with PHP delimiters, for example:
<p>Welcome <?php echo e($first_name); ?>,</p>
Any suggestions?
source
share