0
votes

In my routes file I have

Route::post('/request-rest-password', 'HomeController@requestResetPwd');

IN the controller

  public function requestResetPwd(Request $request){
      return $request;
  }

Now whenever I try post it always throws an error

"exception": "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException","file": "/var/www/html/freelancer/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php",

Where could I be going wrong Example of a post

$ curl -X POST -H "Accept: application/json" -F "[email protected]" -F  ....... 
        "http://localhost:8000/request-reset-pwd"
2
this will be your link : localhost:8000/request-reset-passworduser223321

2 Answers

2
votes

You have a typo:

Route: request-rest-password
POST: request-reset-pwd

0
votes
Route::post('/request-rest-password', 'HomeController@requestResetPwd')->name('post_insert');

and your form html should contain route like this ...

<form method="post" action="{{route('post_insert')}}">
{{csrf_field()}}
  your user fields goes here...
</form>