mardi 22 mars 2016

Patch route gives 404, even when the route is defined and exists

I have this route for edit and update

//Designation Details for Staffs
Route::get('designation/{staffid}', array(
  'as' => 'designation.edit',
  'uses'=>'StaffController@editDesignation'));
Route::patch('designation/update/{staffid}', array(
  'as' => 'designation.update',
  'uses'=>'StaffController@updateDesignation'));

The edit Route is working fine with the form model as:

{!! Form::model($designation, [
        'method' => 'PATCH',
        'route' => ['designation.update', $designation->staffid]
        ]) !!}

But, when the Submit button is clicked for update, it has the url

http://localhost/hrm/public/designation/update/2

and leads to 404. Just letting you know, all other routes are working fine. For similar case, another update route:

Route::patch('staff/update/{id}', array(
  'as' => 'staff.update',
  'uses'=>'StaffController@update'));

is working fine as well. TIA.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire