Skip to content

Commit

Permalink
Add a check to ensure cached code/routes exist before including them
Browse files Browse the repository at this point in the history
  • Loading branch information
carnage committed Feb 26, 2024
1 parent e60a387 commit 58f41ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public function register(): void
/** @return Builder[] */
private function instantiateBuilders(): array
{
/** @phpstan-ignore-next-line */ // config is a laravel framework helper method
if (!file_exists(config('membrane.routes_file')) || empty(config('membrane.additional_builders'))) {
return [];
}

/** @phpstan-ignore-next-line */ // config is a laravel framework helper method
$router = new Router(new RouteCollection(include config('membrane.routes_file')));

Expand Down

0 comments on commit 58f41ad

Please sign in to comment.