I have Customer Controller with index, edit, update methods
Route::resource('customer', 'CustomerController');
Controller methods update
public function update($id) { echo $id; }
my HTML Form
<form action="/customer/1" method="post">
<input type="text" name="email" value="" />
<input type="submit" value="" />
</form>
I have following a Documentation here http://four.laravel.com/docs/controllers#resource-controllers PUT/PATCH /resource/{id} update
It's seems not working for me, how to use it? thank you
To use the
PATH
,PUT
orDELETE
HTML methods you need to add a hidden input with_method
. Like the following...You can use the Form Builder. Example using blade:
That will automatically add this for you
I am using Laravel resource controller. For update a page, I copied it from insert page after then
Just I added an extra field to update view like as
Just use this as for update
This works for me in Laravel 4: