diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 469bc9b..9573fe6 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -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')));