Skip to content

Commit

Permalink
Update InstallCommand.php
Browse files Browse the repository at this point in the history
APi Route publish command
  • Loading branch information
hafijul233 authored Aug 23, 2024
1 parent ee6c536 commit ded8421
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit ded8421

Please sign in to comment.