@@ 70-75 (lines=6) @@ | ||
67 | return '<?php endif; ?>'; |
|
68 | }); |
|
69 | ||
70 | $bladeCompiler->directive('hasanyrole', function ($arguments) { |
|
71 | list($roles, $guard) = explode(',', $arguments.','); |
|
72 | $roles = $this->convertPipeToArray($roles); |
|
73 | ||
74 | return "<?php if(auth({$guard})->check() && auth({$guard})->user()->hasAnyRole({$roles})): ?>"; |
|
75 | }); |
|
76 | $bladeCompiler->directive('endhasanyrole', function () { |
|
77 | return '<?php endif; ?>'; |
|
78 | }); |
|
@@ 80-85 (lines=6) @@ | ||
77 | return '<?php endif; ?>'; |
|
78 | }); |
|
79 | ||
80 | $bladeCompiler->directive('hasallroles', function ($arguments) { |
|
81 | list($roles, $guard) = explode(',', $arguments.','); |
|
82 | $roles = $this->convertPipeToArray($roles); |
|
83 | ||
84 | return "<?php if(auth({$guard})->check() && auth({$guard})->user()->hasAllRoles({$roles})): ?>"; |
|
85 | }); |
|
86 | $bladeCompiler->directive('endhasallroles', function () { |
|
87 | return '<?php endif; ?>'; |
|
88 | }); |