lundi 29 décembre 2014

Laravel - 404 for destroy launching GET


Vote count:

0




I'm bulding API Laravel 5 application with RESTful controllers. I have method destroy defined this way in controller:



public function destroy($id)
{
App::abort(404);
}


because at the moment I don't want to handle it. The strange thing is when I use such code, I get 404 header but also get output from my show method:



public function show($id)
{
die('show method');
}


so when using DELETE method for my resource I get 404 code with output show method.


I'm 100% sure I'm launching destroy method, because if I put in my destroy method:



public function destroy($id)
{
die('destroy');
}


I will have displayed destroy with 200 status code


I'v tested it in PhpStorm but also with this Firefox addon and in both cases result is the same.


The question is - what is going here and how to return just 404 code without data or with empty data?



asked 34 secs ago







Laravel - 404 for destroy launching GET

Aucun commentaire:

Enregistrer un commentaire