Skip to content

Commit

Permalink
Only register routes from api resources with valid controller
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 28, 2023
1 parent 82e4dbe commit 8375d35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/ApiManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function buildResource($name, $model, $meta = [])
protected function loadResources()
{
$resources = Resource::all()
->filter(function ($resource) {
return class_exists($resource->controller);
})
->filter(function ($resource) {
return resolve($resource->controller)->isClassExtendedWith('Igniter.Api.Actions.RestController');
})
Expand Down

0 comments on commit 8375d35

Please sign in to comment.