[9.x] Add invokable option to make rule command#42742
[9.x] Add invokable option to make rule command#42742taylorotwell merged 5 commits intolaravel:9.xfrom
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.