Reputation: 2457
I'm trying to learn Laravel 5.3, so I'm doing my own password reset. In a "reset email" link, I'm sending myself the following link:
http://localhost:8000/users/newpassword/1/8ur7e1pvag6kx8nl0w
In my routes file I have:
Route::get('/users/newpassword/{$id}/{$remember}', 'UserController@newPassword')->name('usernewpassword');
However when I click the link, I'm getting: NotFoundHttpException in RouteCollection.php line 161:
I'm running this via artisan serve
, so the port part of the link is correct.
I've also created the following method in the Users controller:
public function newPassword($id, $remember) {
return view('users.newpass');
}
Any ideas why this could be? Thanks!
Upvotes: 0
Views: 61
Reputation: 2525
You mistake in route file. It should be like this
Route::get('/users/newpassword/{id}/{remember}', 'UserController@newPassword')->name('usernewpassword');
Instead of this:
Route::get('/users/newpassword/{$id}/{$remember}', 'UserController@newPassword')->name('usernewpassword');
More about route parameters:
Upvotes: 1