laratron icon indicating copy to clipboard operation
laratron copied to clipboard

remove response type

Open iafilin opened this issue 4 years ago • 2 comments

Return value of Sandulat\Laratron\Http\Middleware\LaratronMiddleware::handle() must be an instance of Illuminate\Http\Response, instance of Illuminate\Http\JsonResponse returned

I use VueJS and InetriaJS. My controllers return HTML on first access and JSON on site navigation (this is a feature of IntertiaJs for getting rid of the API).

Removing type solved my problem.

Thank!

P.S. Sorry for bad english

iafilin avatar Jul 15 '20 10:07 iafilin

Hey @geekfil! Thank you very much for submitting a PR. Sorry for the delayed response.

I think that it would be better if we'd keep a return type, but another one.

If I'm not mistaken, both Illuminate\Http\Response and Illuminate\Http\JsonResponse extend Symfony\Component\HttpFoundation\Response. Could you please try to add Symfony\Component\HttpFoundation\Response as the return type of the LaratronMiddleware::handle() method and let me know if it worked out?

sandulat avatar Jul 20 '20 08:07 sandulat

@sandulat Hello. Yes it worked! Thank.

iafilin avatar Aug 01 '20 19:08 iafilin