Skip to content

Commit

Permalink
some improvements and add information to console to add route to RSP
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gaal committed Feb 18, 2022
1 parent 790b83c commit 19469b7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Commands/MakeRouteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@

class MakeRouteCommand extends Command
{
protected $signature = 'beyond:make:route {application}';
protected $signature = 'beyond:make:route {routeName}';

protected $description = 'Make a new file for routes';

public function handle()
{
$application = $this->argument('application');
$applicationNameLowerCase = strtolower($application);
$routeName = $this->argument('routeName');
$routeNameLowerCase = mb_strtolower($routeName);

beyond_copy_stub(
'routes.stub',
app_path() . "/../routes/{$applicationNameLowerCase}.php",
base_path() . "/routes/{$routeNameLowerCase}.php",
[
'{{ application }}' => $applicationNameLowerCase,
'{{ application }}' => $routeNameLowerCase,
]
);


$this->info(
"Please add following route entry to your RouteServiceProvider. Please take care of using the correct middleware. This could differ from the default middleware." . PHP_EOL . PHP_EOL .

"\tRoute::prefix('" . $applicationNameLowerCase . "')" . PHP_EOL .
"\tRoute::prefix('{$routeNameLowerCase}')" . PHP_EOL .
"\t\t->middleware('api')" . PHP_EOL .
"\t\t->namespace($this->namespace)" . PHP_EOL .
"\t\t->group(base_path('routes/$applicationNameLowerCase.php'));"
"\t\t->group(base_path('routes/{$routeNameLowerCase}.php'));"
);
}
}

0 comments on commit 19469b7

Please sign in to comment.