| @@ 46-55 (lines=10) @@ | ||
| 43 | 'child' => [], |
|
| 44 | ]); |
|
| 45 | } |
|
| 46 | } else { |
|
| 47 | $config = $this->getConfig($items); |
|
| 48 | if ($config && $config->getAttribute('permissions.view')) { |
|
| 49 | $menus->push([ |
|
| 50 | 'title' => $config->getAttribute('title'), |
|
| 51 | 'url' => route('admin.model.index', ['model' => $items], false), |
|
| 52 | 'child' => [], |
|
| 53 | ]); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | } elseif (is_array($items)) { // child |
|
| 57 | $childs = $this->getMenus($items); |
|
| 58 | if ($childs->isNotEmpty()) { |
|
| @@ 42-49 (lines=8) @@ | ||
| 39 | } |
|
| 40 | } else { |
|
| 41 | $config = app('admin.config.factory')->make($items); |
|
| 42 | if ($config && $config->getAttribute('permissions.view')) { |
|
| 43 | $model = str_replace('.', '/', $items); |
|
| 44 | $menus->push([ |
|
| 45 | 'title' => $config->getAttribute('title'), |
|
| 46 | 'url' => route('admin.model.index', ['model' => $model], false), |
|
| 47 | 'child' => [], |
|
| 48 | ]); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | } elseif (is_array($items)) { // child |
|
| 52 | $childs = $this->getAdminMenu($items); |
|