samedi 2 janvier 2016

Define controller method as form action

I have a following code

{!! Form::open(array('action' => 'clientController@create')); !!}

it shouts that clientController@create is not defined unless I put some code into routes.php (this is my solution)

Route::post('clientRegistration', ['uses' => 'clientController@create', 'as' => 'registration']);

Everything then works fine, but I am not sure if I have found the correct solution, do I have to create a route for every form that will be created? I don't know why Laravel could not find a controller method without registering it in routes.php file



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire