Support the ongoing development of Laravel.io →
posted 10 years ago
Forms

I have a form where the user can update the fields of the given ID, also you have other fields you can't modify but are filled (the reason using "Form::model"). The problem, I cant change the "method" to "PUT", it looks like is forced to be "POST" and the Route->resource->instituciones can't catch it. The form:

{{ Form::model($institucion, array('route' => array('instituciones.update', $institucion->id_institucion), 'method' => 'ALWAYSPOST')) }}

shows always "POST"

<form accept-charset="UTF-8" action="http://localhost/geseduc/public/instituciones/1" method="POST">

I know I can change the route or the form to Form::open, but for me looks to be inconsistent because the "resource" are the native way you can route, and "Form::model" is the native way you can fill into the form. May I'm doing wrong something??

Last updated 3 years ago.
0

Ok, don't know why it doesn't worked before, but now I tried again and figured a hidden input!!

<input type="hidden" value="PUT" name="_method">

Solved! XD

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

punchi punchi Joined 15 Sep 2014

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.

© 2025 Laravel.io - All rights reserved.