You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the Blade directives such as @impersonating() and @endImpersonating() stooped working, instead they were being rendered as HTML on the frontend.
After some digging and debugging I found out that the "problem" lies in the way that the directives are registered.
I also found a way to fix the issue, but I admit that I'm not sure about the technical reason behind the problem, I didn't have time to dig more into it.
Note: The issue started after the Laravel 9 upgrade.
Actual implementation:
publicfunctionregister()
{
...$this->registerBladeDirectives();
...
}
protectedfunctionregisterBladeDirectives()
{
$this->app->afterResolving('blade.compiler', function (BladeCompiler$bladeCompiler) {
/// register the Blade directives
});
}
What also works:
If it's really necessary to place the directive declaration inside the register method, do not wrap it with the ...afterResolving('blade.compiler',... callback, that also worked with my tests.
The text was updated successfully, but these errors were encountered:
I noticed that the Blade directives such as
@impersonating()
and@endImpersonating()
stooped working, instead they were being rendered as HTML on the frontend.After some digging and debugging I found out that the "problem" lies in the way that the directives are registered.
I also found a way to fix the issue, but I admit that I'm not sure about the technical reason behind the problem, I didn't have time to dig more into it.
Note: The issue started after the Laravel 9 upgrade.
Actual implementation:
My fix:
What also works:
If it's really necessary to place the directive declaration inside the
register
method, do not wrap it with the...afterResolving('blade.compiler',...
callback, that also worked with my tests.The text was updated successfully, but these errors were encountered: