takielias/tablar-crud-generator

Route not found

Opened this issue · 1 comments

when generating a new crud on a plural table, the route is created in the singular, but the references are in the plural. There is therefore an error when using the route: throw new RouteNotFoundException("Route [{$name}] not defined.");.

The error is on line 276 in the command vendor\takielias\tablar-crud-generator\src\Commands\GeneratorCommand.php.

The fix to apply is: '{{modelRoute}}' => $this->options['route'] ?? Str::kebab(Str::plural($this->name, 1)), instead of '{{modelRoute}}' => $this->options['route'] ?? Str::kebab(Str::plural($this->name)),

@open-soft-app Could you please make a PR?