May I pass arguments to the L5 `FormRequest::authorize()`?

Posted 4 years ago by mtvs_dev

In an update() process I want to

  1. Attempt to grab the resource/record that is requested to be updated,
  2. Check if it is existed
  3. Check if the user owns the resource (authorization)
  4. Validate input ...

So I want to instantiate my FormRequest after the first two step not by method injection, and pass the grabbed resource to its authorize() method.

Can I do this, and if yes how?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.