diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 469bc9b..fb84231 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -53,6 +53,10 @@ public function register(): void /** @return Builder[] */ private function instantiateBuilders(): array { + 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')));