laratron
laratron copied to clipboard
remove response type
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
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 Hello. Yes it worked! Thank.