| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function getAll () |
||
| 21 | { |
||
| 22 | // Use the links from config/panel.php |
||
| 23 | $config = config('panel.links'); |
||
| 24 | |||
| 25 | return collect($config)->map(function ($spec, $label) { |
||
| 26 | if (is_int($label)) { // This is just a string without a key (short notation) |
||
| 27 | $label = $spec; |
||
| 28 | $spec = null; |
||
| 29 | } |
||
| 30 | return [ |
||
| 31 | 'display' => $label, |
||
| 32 | 'url' => data_get($spec, 'model', Str::singular($label)), |
||
| 33 | 'show_menu' => data_get($spec, 'show_menu', true), |
||
| 34 | 'main' => !data_get($spec, 'custom', true), |
||
| 35 | ]; |
||
| 36 | })->values(); |
||
| 37 | } |
||
| 38 | |||
| 48 | } |