diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 53ce52b..7f3e800 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -53,10 +53,14 @@ public function handle() private function configureRouteFile(): void { - $routeFilePath = base_path(config('crud.route_path', 'routes/api.php')); + $routeFilePath = base_path(config('crud.route_path', 'routes'. DIRECTORY_SEPARATOR .'api.php')); if (! is_file($routeFilePath)) { - throw new InvalidArgumentException("Invalid API route file path: ({$routeFilePath})."); + if ($this->confirm("Invalid API route file path: ({$routeFilePath}). Create one?", false)) { + + } else { + throw new InvalidArgumentException("Invalid API route file path: ({$routeFilePath})."); + } } if (! is_readable($routeFilePath)) {