Laravel's Blade::compileString() doesn't seem to work properly when the @push statement is contained within compiled string #44753
Unanswered
adam-jones-net
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to load a file (basically a blade file) into my code and then inject it into a page dynamically.
This worked perfectly with a blade file I have using the following code:
However I understand that this function is meant to be able to handle standard blade functions and directives and I needed to add a @Push statement. So I now have a template being loaded that looks like this:
The problem is that the initial @Push command, whilst it does get processed (and the content of the push written into the 'scripts' element of my parent template) it also writes into the compiled string some unexpected output. Below is the output of my sample script and the part in bold is what is unexpected.
This should be easy to reproduce... I'm using Laravel 9.30 if of use. Does anyone have any work arounds or has seen this before?
Beta Was this translation helpful? Give feedback.
All reactions