| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function getResource(): string |
||
| 25 | { |
||
| 26 | $resources = config('cms.resources'); |
||
| 27 | |||
| 28 | // Return a 404 response if the resource is not found |
||
| 29 | if (! array_key_exists($this->route('resource'), $resources)) { |
||
| 30 | throw new NotFoundHttpException('resource not found'); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $resources[$this->route('resource')]; |
||
| 34 | } |
||
| 35 | |||
| 61 |