2

I have form like this

<form action="{{ Request::root() }}/articles/update/" method="post">
    <input type="hidden" name="id" value="{{ $article->id }}" />
    <input type="submit" name="submit" value="Submit" />
</form>

And route like this

Route::post('articles/update', array('as' => 'articleUpdate', 'uses' => 'ArticlesController@update'));

But when I submit the form, I get MethodNotAllowedHttpException. In error report I can see that request method is GET. I have also tried using caps for method method="POST" but it didn't work.

Any ideas?

Vuk Stanković
  • 7,864
  • 10
  • 41
  • 65

2 Answers2

2

What does FireBug/Web console inspector show you? is the form being sent via GET or POST, any redirects?

Seems a redirection problem to me, after reaching the server Laravel redirects to the URL the form sent the post request.

Ast Derek
  • 2,739
  • 1
  • 20
  • 28
0

you must use put method here. Form change like this

 {{Form::open(array('url'=>'/articles/update','method' => 'PUT'))}}

Routes like this

 Route::put('/articles/update','ArticlesController@update');