| Total Complexity | 7 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class GateFilter implements FilterInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Transforms a menu item. Add the restricted property to a menu item |
||
| 11 | * when the it's not authorized by the Laravel's Gate feature. |
||
| 12 | * |
||
| 13 | * @param array $item A menu item |
||
| 14 | * @return array |
||
| 15 | */ |
||
| 16 | 56 | public function transform($item) |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Check if a menu item is authorized to be shown for the current user. |
||
| 30 | * |
||
| 31 | * @param array $item A menu item |
||
| 32 | * @return bool |
||
| 33 | */ |
||
| 34 | 56 | protected function isAuthorized($item) |
|
| 55 |