-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Api] Laravel feature breaks Api Validated Request abstraction #167
Comments
aedart
changed the title
[Api] Laravel features breaks Api Validated Request abstraction
[Api] Laravel feature breaks Api Validated Request abstraction
Apr 20, 2023
aedart
added a commit
that referenced
this issue
Apr 20, 2023
aedart
added a commit
that referenced
this issue
Apr 20, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The Class based after validation rules feature that was introduced in Laravel
v10.8.0
breaks theApiValidatedRequest
abstraction, because it automatically invokes theafter()
method and expects it to return an array of additional validation rules. This break was reported, but sadly rejected. Now, consumers of the validation abstraction have their applications broken.Possible solution
To avoid introducing a breaking chance in Athenaeum, Laravel's new feature must, sadly, be force disabled. This should be doable by overwriting the
getValidatorInstance()
(defined inFormRequest
) and comment out theif (method_exists($this, 'after')) ...
statement.However, this is only a short term solution. The
after()
that is defined inApiValidatedRequest
must now be deprecated and a replacement method name must be introduced, such that the same behaviour can be kept. In the next major version, theafter()
method can be safely removed, documented in the migration plan and the "fix" code can be removed entirely, which will also re-enable Laravel's feature.The text was updated successfully, but these errors were encountered: