| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function getEndpoints(Model $model = null): array |
||
| 46 | { |
||
| 47 | $formattedAction = $this->formatAction(); |
||
| 48 | |||
| 49 | $route = app(Router::class) |
||
| 50 | ->getRoutes() |
||
| 51 | ->getByAction($formattedAction); |
||
| 52 | |||
| 53 | if ($route === null) { |
||
| 54 | throw new Exception("Route `{$formattedAction}` does not exist!"); |
||
| 55 | } |
||
| 56 | |||
| 57 | return RouteEndpointType::make($route) |
||
| 58 | ->name($this->name) |
||
| 59 | ->httpVerb($this->httpVerb) |
||
| 60 | ->prefix($this->prefix) |
||
| 61 | ->parameters($this->getParameters($model)) |
||
| 62 | ->getEndpoints($model); |
||
| 63 | } |
||
| 64 | |||
| 79 |