Clarification on ActionRequest #176
Unanswered
chrisk-7777
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
-
Re the docs: https://laravelactions.com/2.x/add-validation-to-controllers.html#authorization
I read this to mean: by including
ActionRequest
it will invokerules()
andauthorize()
(eg:
function asController(ActionRequest $request)
)However, from my own testing,
rules()
andauthorize()
are invoked regardless ifActionRequest
is used or not.What I would like to confirm is: is it expected for
rules()
andauthorize()
to be called even without anActionRequest
?Or am I relying on undocumented behavior that might get fixed/changed in future?
Example:
Note I am not using
WithAttributes
Output:
Beta Was this translation helpful? Give feedback.
All reactions