I'm calling a route with a variable appended to it's end, like this:
Route::get('/user/{user}', 'UserController@listUser');
That points to a controller with a method like so:
public function listUser(User $user){
dd($user);
}
That's working just fine; if I go to www.example.com/user/3, Laravel will automatically fetch me the user with id = 3
But I need to change that URL to something like this: www.example.com/users/nickname using a different property of the User model.
If that's possible, how can I do it?