Unable to use use
statements in a blade template that is included
#15
Labels
bug
Something isn't working
use
statements in a blade template that is included
#15
I thought I'd just add an issue so that this doesn't get lost, however I'm currently looking into it a bit. 👍🏻
See owenvoke#3 for a fixture that demonstrates this issue.
When using the
@include()
directive with a file that contains use statements, in standard Blade it compiles to separate files, whereas (AFAICT) this package compiles to a single file which is checked (correct me if I'm wrong). But this causes the use statements to fail as they are in the global scope. Resulting in a PHP syntax error.The error that will be output is:
Looks like it's because the
use
statement is embedded inside afunction
block when it's compiled. 🤔 e.g.The text was updated successfully, but these errors were encountered: