Support the ongoing development of Laravel.io →
Input Forms
Last updated 2 years ago.
0

It needs an ID of the resource you're editing in the action param. I would recommend you doing a php artisan route:list it always helps me when I forget the syntax.

EDIT:

Relevant doc page: http://laravel.com/docs/5.1/controllers#restful-resource-controllers

Last updated 9 years ago.
0

@tepeters in HTML there's no actual method called PUT or PATCH - there's only GET and POST. So when you call Form::open with Laravel, it actually changes it to POST with hidden field. Something like this:

<form method="POST" action="xxxxxx/clients/20" accept-charset="UTF-8">  
<input name="_method" type="hidden" value="PATCH">
0

I was able to find the solution using a named route as the action instead of an actual path. In addition, using the "POST" method similar to @PovilasKorop (thanks!)

Here's the solution for the opening tag:

<form action="{{ route('umdusers.update', $umduser->id) }}" method="POST">
    <input type="hidden" name="_method" value="PUT">
0

Sign in to participate in this thread!

Eventy

Your banner here too?

tepeters tepeters Joined 25 Jun 2015

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.