protected function registerBladeDirectives()
    {
        /** @var BladeCompiler $blade */
        $blade = $this->app['blade.compiler'];
        $blade->directive('canAtLeast', function ($expression) {
            return "<?php if (app('laravel-acl.directives.canAtLeast')->handle({$expression})): ?>";
        });
        $blade->directive('endCanAtLeast', function ($expression) {
            return '<?php endif; ?>';
        });

        /** @deprecated Please use @role directive. */
        $blade->directive('isRole', function ($expression) {
            return "<?php if (app('laravel-acl.directives.role')->handle({$expression})): ?>";
        });
        $blade->directive('endIsRole', function ($expression) {
            return '<?php endif; ?>';
        });

        $blade->directive('role', function ($expression) {
            return "<?php if (app('laravel-acl.directives.role')->handle({$expression})): ?>";
        });
        $blade->directive('endRole', function ($expression) {
            return '<?php endif; ?>';
        });

        $blade->directive('hasRole', function ($expression) {
            return "<?php if (app('laravel-acl.directives.hasRole')->handle({$expression})): ?>";
        });
        $blade->directive('endHasRole', function ($expression) {
            return '<?php endif; ?>';
        });
    }