Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodevs committed Jan 1, 2025
1 parent 0b8926c commit 9b1c308
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Generators/RouteGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ protected function buildRoutes(Controller $controller): string
$className = $this->getClassName($controller);
$slug = config('blueprint.singular_routes') ? Str::kebab($controller->prefix()) : Str::plural(Str::kebab($controller->prefix()));

if ($controller->parent()) {
$parentSlug = config('blueprint.singular_routes') ? Str::kebab($controller->parent()) : Str::plural(Str::kebab($controller->parent()));
$parentBinding = '/{' . Str::kebab($controller->parent()) . '}/';
$slug = $parentSlug . $parentBinding . $slug;
}

foreach (array_diff($methods, Controller::$resourceMethods) as $method) {
$routes .= $this->buildRouteLine($className, $slug, $method);
$routes .= PHP_EOL;
Expand Down

0 comments on commit 9b1c308

Please sign in to comment.