I have Permission Roles that i want to delete when i click on them so i did a route that takes role id and permission id
Route::post('management/role-permission/{role_id}/{permission_id}', 'RolePermissionsController@Delete');
And i get this route from link from my html:
@foreach($data as $dat)
<div class="col-xs-3 text-center">
<form action="/management/role-permission//" method="POST">
{!! csrf_field() !!}
<button onclick="return confirm('Are you sure?')" class="btn turquoiseButton btn-margin full-width"><i class='fa fa-close close-btn'></i> </button>
</form>
</div>
@endforeach
And the route goes to this controller :
public function Delete( $role_id ,$permission_id)
{
$role_permission=DB::table('permission_role')
->where('role_id' ,$role_id)
->where('permission_id' ,$permission_id)
->delete();
return Redirect::to('/management/role-permission/'.$role_id . '/list');
}
But i keep getting this error for no reason
MethodNotAllowedHttpException
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire