Laratrust\LaratrustRegistersBladeDirectives::registerWithParenthesis PHP Method

registerWithParenthesis() protected method

Registers the directives with parenthesis
protected registerWithParenthesis ( ) : void
return void
    protected function registerWithParenthesis()
    {
        // Call to Laratrust::hasRole
        Blade::directive('role', function ($expression) {
            return "<?php if (app('laratrust')->hasRole({$expression})) : ?>";
        });
        // Call to Laratrust::can
        Blade::directive('permission', function ($expression) {
            return "<?php if (app('laratrust')->can({$expression})) : ?>";
        });
        // Call to Laratrust::ability
        Blade::directive('ability', function ($expression) {
            return "<?php if (app('laratrust')->ability({$expression})) : ?>";
        });
    }