protected function registerBlade5_0()
    {
        $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();
        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createMatcher('role');
            return preg_replace($pattern, '<?php if (Auth::check() && Auth::user()->is$2): ?> ', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createPlainMatcher('endrole');
            return preg_replace($pattern, '<?php endif; ?>', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createMatcher('permission');
            return preg_replace($pattern, '<?php if (Auth::check() && Auth::user()->can$2): ?> ', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createPlainMatcher('endpermission');
            return preg_replace($pattern, '<?php endif; ?>', $view);
        });
    }
protected function registerBlade5_0()
    {
        $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();
        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createMatcher('role');
            return preg_replace($pattern, '<?php if (Auth::check() && Auth::user()->is$2): ?> ', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createPlainMatcher('endrole');
            return preg_replace($pattern, '<?php endif; ?>', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createMatcher('permission');
            return preg_replace($pattern, '<?php if (Auth::check() && Auth::user()->can$2): ?> ', $view);
        });

        $blade->extend(function ($view, $compiler) {
            $pattern = $compiler->createPlainMatcher('endpermission');
            return preg_replace($pattern, '<?php endif; ?>', $view);
        });
    }
protected function registerBlade5_0 ( ) { $ blade = $ this -> app [ 'view' ] -> getEngineResolver ( ) -> resolve ( 'blade' ) -> getCompiler ( ) ; $ blade -> extend ( function ( $ view , $ compiler ) { $ pattern = $ compiler -> createMatcher ( 'role' ) ; return preg_replace ( $ pattern , '<?php if (Auth::check() && Auth::user()->is$2): ?> ' , $ view ) ; } ) ; $ blade -> extend ( function ( $ view , $ compiler ) { $ pattern = $ compiler -> createPlainMatcher ( 'endrole' ) ; return preg_replace ( $ pattern , '<?php endif; ?>' , $ view ) ; } ) ; $ blade -> extend ( function ( $ view , $ compiler ) { $ pattern = $ compiler -> createMatcher ( 'permission' ) ; return preg_replace ( $ pattern , '<?php if (Auth::check() && Auth::user()->can$2): ?> ' , $ view ) ; } ) ; $ blade -> extend ( function ( $ view , $ compiler ) { $ pattern = $ compiler -> createPlainMatcher ( 'endpermission' ) ; return preg_replace ( $ pattern , '<?php endif; ?>' , $ view ) ; } ) ; }
Register Blade Template Extensions for <= L5.0
Register Blade Template Extensions for < = L5 . 0