Learner\Providers\AuthBladeServiceProvider::boot PHP Method

boot() public method

Bootstrap any application services.
public boot ( ) : void
return void
    public function boot()
    {
        Blade::directive('role', function ($expression) {
            return "<?php if(Auth::check() && Auth::user()->hasRole{$expression}): ?>";
        });
        Blade::directive('endrole', function ($expression) {
            return "<?php endif ?>";
        });
        Blade::directive('permission', function ($expression) {
            return "<?php if(Auth::check() && Auth::user()->can{$expression}): ?>";
        });
        Blade::directive('endpermission', function ($expression) {
            return "<?php endif ?>";
        });
        Blade::directive('ability', function ($expression) {
            return "<?php if(Auth::check() && Auth::user()->ability{$expression}): ?>";
        });
        Blade::directive('endability', function ($expression) {
            return "<?php endif ?>";
        });
    }
AuthBladeServiceProvider