-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[9.x] Add invokable option to make rule command #42742
Conversation
@timacdonald should we transition to making "invokable" rules the default class based custom rules we document as well as the default type of rules we generate from the CLI? |
@taylorotwell I do feel that making these the "default" is the way to go. It creates consistency across the rule APIs (Invokable class / Closure based), they have better DX for more complicated rules (as shown in the PR), and is one less decision for developers to make when creating rules e.g. "which rule type do we use". |
Should we be handling the combination of |
Yea, for 9.x I think we should handle both of these. @snarcraft, if you have the space, could you add support for the following....
If you don't have space right now, just let me know and I can jump in for ya. Will convert this one to a draft until we have it ready. |
@timacdonald there you go! |
src/Illuminate/Foundation/Console/stubs/rule.invokable.implicit.stub
Outdated
Show resolved
Hide resolved
…t.stub Co-authored-by: Tim MacDonald <hello@timacdonald.me>
Following the PR #42689, this new PR adds an option to make an invokable rule to the existing make rule command.
This minor feature comes with no breaking change, the previous command will still work as usual.
For the end users, this additional option can be useful to generate an invokable rule.