Sometimes read the documentation
Route::resource('kunden', ClientController::class)->names([
'index' => 'clients.index',
'create' => 'clients.create',
'store' => 'clients.store',
'show' => 'clients.show',
'edit' => 'clients.edit',
'update' => 'clients.update',
'destroy' => 'clients.destroy'
])->parameters([
'kunden' => 'client'
]);
https://laravel.com/docs/8.x/controllers#restful-naming-resource-routes
https://laravel.com/docs/8.x/controllers#restful-naming-resource-route-parameters
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
Route::resourceVerbs([
'create' => 'erstellen',
'edit' => 'bearbeiten'
]);
// ...
}
https://laravel.com/docs/8.x/controllers#restful-localizing-resource-uris
But probably better will be do it manually.
Or create a helper something like this
if (! function_exists('route_resource')) {
function route_resource($route, $parameter, $except = [], $name = null)
{
if (! $name) {
$name = Str::kebab(Str::plural($parameter));
}
return [
'names' => [
'index' => "{$name}.index",
'create' => "{$name}.create",
'store' => "{$name}.store",
'show' => "{$name}.show",
'edit' => "{$name}.edit",
'update' => "{$name}.update",
'destroy' => "{$name}.destroy"
],
'parameters' => [$route => $parameter],
'except' => $except
];
}
}
Then it could be
Route::resource('kunden', ClientController::class, route_resource('kunden', 'client'));