I'm currently trying out Laravel 4 and I have created a resource controller. In the 'edit' function I'm building a form, which should post to the 'update' function.
To create the form open tag I use the Form::open()
function which recently got added to Laravel 4 it seems.
But when I just do Form::open()
the action of the form is the current url and I can't figure out how to change the action.
I tried Form::open('clients/' . $client->id)
but this gives me the following error:
ErrorException: Catchable Fatal Error: Argument 1 passed to Illuminate\Html\FormBuilder::open() must be of the type array
So I tried Form::open('[clients/' . $client->id)
. This doesn't generate an error, but now the form open tag is:
<form method="POST" action="http://boekhouding.dev/clients/1/edit" accept-charset="UTF-8" clients/1="clients/1">
And I also tried it like this: Form::open(['action' => 'clients/' . $client->id])
but when I do it like this, the form open tag has no action at all.
So, does anyone know how to set the form action? Using a named route would be perfect, but even being able to set the action at all would be nice.