Skip to content

Commit 653e05d

Browse files
committed
implements compileAuth and compileEndauth
1 parent 154f974 commit 653e05d

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/Illuminate/View/Compilers/BladeCompiler.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ protected function compileEndenv($expression)
691691
* @param string $expression
692692
* @return string
693693
*/
694-
protected function compileProduction(string $expression)
694+
protected function compileProduction($expression)
695695
{
696696
return "<?php if (app()->environment('production')): ?>";
697697
}
@@ -705,6 +705,24 @@ protected function compileEndproduction($expression)
705705
return '<?php endif; ?>';
706706
}
707707

708+
/**
709+
* @param string $expression
710+
* @return string
711+
*/
712+
protected function compileAuth($expression)
713+
{
714+
return "<?php if (\Auth::check()): ?>";
715+
}
716+
717+
/**
718+
* @param string $expression
719+
* @return string
720+
*/
721+
protected function compileEndauth($expression)
722+
{
723+
return '<?php endif; ?>';
724+
}
725+
708726
/**
709727
* Register a custom Blade compiler.
710728
*

0 commit comments

Comments
 (0)