lundi 26 septembre 2016

automatic method POST or PUT in laravel form collective

I am using laravel form collective for automatic form generation in project. I used same form for add and update with route model binding

{!!  Form::model($operator, ['route' => ['operator.update', $operator->id]])  !!}

and route for this is

 Route::resource('operator','OperatorController');

This generates automatic routes for method like POST for store and PUT for updates

if I use form collective then by default method is POST for both store and update if I change to PUT then it changed for both

I need automatic method detection like if I am using for store, it should be POST and PUT if it is edit form

can we do this ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire