I'm trying to use my Api to delete an object, I'm using restangular so here is how I do my request :
function destroy( resource )
{
clear( this.cache );
return this.restangular.one(this.route, resource.uuid).remove();
}
TmService.destroy(tmToDelete.id)
The request is good, all other ones works (get request), but this one I have the error DELETE ... (Method not allowed).
I think this problem comes from my header, but in the Api I already put this :
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, PATCH, DELETE');
header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Origin, Authorization, X-HTTP-Method-Override');
What can I do ?
Edit:
here is my routes :
Route::resource('/tm', 'TmController');
And with artisan route:list :