How can add custom HTTP status code from Policy (402) to Responses #657
Unanswered
jakubforman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, how can I add a custom status code to the listing. It automatically loads
200
,403
and422
but for my needs I have402
which is returned from Policy if it doesn't pass validation rules.Yes
402
because it is a license status, if the user has a lower license and therefore needs a higher license, he needs to pay. That's why I'm showing that402
and not403
.I tried to rewrite the PHPDoc, but none that I tried helped. Edited differently @response but also nothing. Create a custom Extension but also nothing.
The
@throws LicenseException
in the documentation is just for help, it is never raised in the code because I use$this->authorizeResource(Spot::class);
directly in__construct()
and use .Index method
Extension
Policy
Beta Was this translation helpful? Give feedback.
All reactions