We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea2563a commit e90a1f0Copy full SHA for e90a1f0
src/Blade.php
@@ -292,11 +292,11 @@ protected function setupDefaultDirectives()
292
});
293
294
$this->compiler()->directive('auth', function ($expression) {
295
- return "<?php if (!!auth($expression)->user()) : ?>";
+ return "<?php if (function_exists('auth') && !!auth($expression)->user()) : ?>";
296
297
298
$this->compiler()->directive('guest', function ($expression) {
299
- return "<?php if (!auth($expression)->user()) : ?>";
+ return "<?php if (!function_exists('auth') || (function_exists('auth') && !auth($expression)->user())) : ?>";
300
301
302
$this->directive('is', function ($expression) {
0 commit comments