| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 10 | public static function getAuthGuards(Request $request) |
|
| 17 | { |
||
| 18 | 10 | $middlewares = $request->route()->middleware(); |
|
| 19 | |||
| 20 | 10 | $guards = []; |
|
| 21 | 10 | foreach ($middlewares as $middleware) { |
|
| 22 | 10 | if (Str::startsWith($middleware, 'auth')) { |
|
| 23 | 9 | $explodedGuards = explode(',', Str::after($middleware, ':')); |
|
| 24 | 10 | $guards = array_unique(array_merge($guards, $explodedGuards)); |
|
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | 10 | return $guards; |
|
| 29 | } |
||
| 30 | |||
| 56 |