Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove response type #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

remove response type #2

wants to merge 3 commits into from

Conversation

iafilin
Copy link

@iafilin iafilin commented Jul 15, 2020

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

@sandulat
Copy link
Owner

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?

@iafilin
Copy link
Author

iafilin commented Aug 1, 2020

@sandulat Hello. Yes it worked! Thank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants