Maybe there is a route that intercept this one.
Jun 16, 2015
6
Level 1
Submitting GET form doesn't trigger route
So i have a very strange problem occurring at the moment where i have a form that that submits as POST and triggers the route fine, whereas if the the form submits as GET it does not get triggered. It is just the strangest thing, in its simplified form the code looks like:
Works
route:
route::post('/contributions/finalise', [ 'as' => 'contributions.finalise', 'uses' => function() {
dd('i get output');
}]);
form:
{!! Form::open(['route' => 'contributions.finalise', 'method' => 'POST']) !!}
{!! Form::input('hidden','amount', null, ['id' => "contribute-amount"]) !!}
<button type="submit">Submit</button>
{!! Form::close() !!}
Doesn't work
route:
route::get('/contributions/finalise', [ 'as' => 'contributions.finalise', 'uses' => function() {
dd('i DONT get output, only a white screen is shown.');
}]);
form:
{!! Form::open(['route' => 'contributions.finalise', 'method' => 'GET']) !!}
{!! Form::input('hidden','amount', null, ['id' => "contribute-amount"]) !!}
<button type="submit">Submit</button>
{!! Form::close() !!}
As you can see they are very similar but the GET just doesn't work? Am i missing something really basic here?
Thanks for your help
Level 52
Maybe this one :
Route::resource('contributions', 'Contributions\ContributionsController');
2 likes
Please or to participate in this conversation.