Я новичок в Laravel.Я хочу иметь форму смены пароля в моем приложении.мой взгляд выглядит так:
<form action="{{ route("profile.changePassword") }}" method="post">
{{ csrf_field() }}
{{--{{ method_field('PUT') }}--}}
<div class="form-group">
<label for="old">Old password</label>
<input value="" type="password" name="old" class="form-control" id="old">
</div>
<div class="form-group">
<label for="new">New password</label>
<input value="" type="password" name="new" class="form-control" id="new">
</div>
<div class="form-group">
<label for="rep">Repeat new password</label>
<input value="" type="password" name="rep" class="form-control" id="rep">
</div>
<div class="text-center">
<button type="submit" class="btn btn-success">Update</button>
</div>
мой контроллер выглядит так:
public function changePassword()
{
return view('profile.passwordReset');
}
public function resetPassword($request)
{
dd($request);
}
и мой маршрут выглядит так:
Route::group(['prefix' => 'panel'], function (){
Route::resource("profile", "ProfileController", ['except' => 'index']);
Route::get("/changepassword", "ProfileController@changePassword")->name('profile.changePassword')->middleware('auth');
Route::post("/resetPassword", "ProfileController@resetPassword")->name('profile.resetPassword')->middleware('auth');
});
Но после отправкиЯ получаю сообщение об ошибке:
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException Нет сообщения
Я изменяю post("/resetPassword"...
на any("/resetPassword"...
и снова получаю ту же ошибку.