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

Response vs. JsonResponse #214

Closed
szepeviktor opened this issue Feb 9, 2021 · 1 comment
Closed

Response vs. JsonResponse #214

szepeviktor opened this issue Feb 9, 2021 · 1 comment

Comments

@szepeviktor
Copy link

if ($prop instanceof Responsable) {
$prop = $prop->toResponse($request)->getData();
}

Hello! Running larastan static analysis on inertia-laravel I wonder how you can make sure that $prop->toResponse($request) is a JsonResponse thus having the getData method.

Please advise.

 ------ -----------------------------------------------------------------------------------
  Line   src/Response.php
 ------ -----------------------------------------------------------------------------------
  74     Call to an undefined method Symfony\Component\HttpFoundation\Response::getData().
 ------ -----------------------------------------------------------------------------------
@szepeviktor
Copy link
Author

Thank you @claudiodekker!

Cc @iamgergo

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

No branches or pull requests

1 participant