Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 1 year ago.
0

i don't see a PUT or PATCH route in your route list

0

astroanu said:

i don't see a PUT or PATCH route in your route list

routelist

It's there.

0

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.

0

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.

0

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.

Last updated 7 years ago.
0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ph0bolus ph0bolus Joined 13 Jul 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.