astroanu said:
i don't see a PUT or PATCH route in your route list
It's there.
just look at your resulting html code. "<form method="POST" ...>" you can either adress PUT/PATCH or POST but not both at the same time. So just delete the part shown above and you should be fine.
LudwigBr said:
just look at your resulting html code. "<form method="POST" ...>" you can either adress PUT/PATCH or POST but not both at the same time. So just delete the part shown above and you should be fine.
I can't delete the PATCH method, since HTML sites can't accept PATCH requests, Laravel inserts it into the page to spoof it into doing a PATCH method.
Ph0bolus said:
LudwigBr said:
just look at your resulting html code. "<form method="POST" ...>" you can either adress PUT/PATCH or POST but not both at the same time. So just delete the part shown above and you should be fine.
I can't delete the PATCH method, since HTML sites can't accept PATCH requests, Laravel inserts it into the page to spoof it into doing a PATCH method.
Thats exactly why you need to put away the "POST" in that statement, because laravel does it on its own. Here a working example of a form which leads to a patch-route:
{!! Form::model($survey, array('action' => ['SurveyController@update', $survey->id], 'method' => 'PATCH')) !!}
And I think the "method"-part in here is already not necessary, because its uses "action" to declare which route should be taken. Nevertheless I am not sure about this one.
EDIT: look at your html part and the output route: "localhost:8000/pages". Thats not the route for an update request. The parameter "userid" is missing in there, its probably emtpy in your example.
EDIT: look at your html part and the output route: "localhost:8000/pages". Thats not the route for an update request. The parameter "userid" is missing in there, its probably emtpy in your example.
Pretty sure this is the problem. Line 13 of your routes has "PUT" for "pages/{pages}" but your <form> action is just "/pages". So, it's not matching to that route.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community