We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the generated API controller, the generated Model Resource is used only for index method.
All other methods simply return the model object.
We should ideally use ModelResource everywhere in the API controller.
In the generated Api\UserController.php
Api\UserController.php
public function show(User $user): User { return $user; }
should be
public function show(User $user): User { return new UserResource($user); }
Similar change for other methods - store and update.
The text was updated successfully, but these errors were encountered:
I would be happy if you pushed the PR. I'll be checking in the next release.
Sorry, something went wrong.
Fix awais-vteams#45 - Return model resource instead of model for api …
8f42caf
…controllers.
101d9ce
Successfully merging a pull request may close this issue.
In the generated API controller, the generated Model Resource is used only for index method.
All other methods simply return the model object.
We should ideally use ModelResource everywhere in the API controller.
In the generated
Api\UserController.php
should be
Similar change for other methods - store and update.
The text was updated successfully, but these errors were encountered: