Code Duplication    Length = 5-5 lines in 2 locations

src/PermissionServiceProvider.php 2 locations

@@ 59-63 (lines=5) @@
56
    protected function registerBladeExtensions()
57
    {
58
        $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {
59
            $bladeCompiler->directive('role', function ($arguments) {
60
                list($role, $guard) = explode(',', $arguments.',');
61
62
                return "<?php if(auth({$guard})->check() && auth({$guard})->user()->hasRole({$role})): ?>";
63
            });
64
            $bladeCompiler->directive('endrole', function () {
65
                return '<?php endif; ?>';
66
            });
@@ 68-72 (lines=5) @@
65
                return '<?php endif; ?>';
66
            });
67
68
            $bladeCompiler->directive('hasrole', function ($arguments) {
69
                list($role, $guard) = explode(',', $arguments.',');
70
71
                return "<?php if(auth({$guard})->check() && auth({$guard})->user()->hasRole({$role})): ?>";
72
            });
73
            $bladeCompiler->directive('endhasrole', function () {
74
                return '<?php endif; ?>';
75
            });