lundi 8 août 2016

Laravel Update route on form submit

I'm using resourceful controller,

Routes.php

Route::resource('admin/reports', 'ReportController');

edit.blade.php

{!! Form::open([ 'route' => array('admin/reports', $report->id),'class' => 'form', 'method' => 'PUT', 'id' => 'reporteditform', 'name' => 'reporteditform', 'files' => true ]) !!}
{!! csrf_field() !!}
 .............
{!! Form::close() !!}  

When I submit the form, It gives me following error

 ErrorException in UrlGenerator.php line 306: Route [admin/reports] not defined. (View: C:\xampp\htdocs\sampleproject\resources\views\admin\reports\edit.blade.php)

Am I doing something wrong with form action url ? Any help is much appreciated..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire