is so simple
Route::resource('users', UsersController::class); // localhost:8000/users/1
to
Route::resource('utilizadores', UsersController::class); // localhost:8000/utilizadores/1
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm portuguese but all my models and code is in english, so image you have a user model and what to generate the resources I will get urls like this /users/1 but I want to change the "users" to "utilizadores", how can I do it easily using Route::resources?
I only want to change the url name and keep everything else for example the url to edit a user will be: domain.com/utilizadores/{user}/edit the name of that route will be users.edit.
I have already find a way to do this but it's lots of code, and I want to know if there are a better approach.
At the moment I have this
Route::resource('utilizadores', App\Http\Controllers\UserController::class, [
'parameters' => [
'utilizadores' => 'user'
],
'names' => [
'index' => 'users.index',
'store' => 'users.store',
'create' => 'users.create',
'show' => 'users.show',
'update' => 'users.update',
'destroy' => 'users.destroy',
'edit' => 'users.edit',
]
]);
Please or to participate in this conversation.