Skip to content
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

[10.x] Make invokable rules default #43868

Merged

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Aug 26, 2022

This PR makes "Invokable" rules the default in Laravel 10.x.

Invokable rules were introduced in #42689 and amongst other things, are more terse than the current rule class and they also have function parity with Closure rules. So there is one less thing to learn / know.

The existing rule classes will of course still be supported by the Validator, it is just that moving forward all rules generated by php artisan make:rule will be the new Invokable validation rule classes.

Warning: This is a change that should likely be recorded in the Upgrade Guide for 10.x.

Documentation PR: laravel/docs#8165

@timacdonald timacdonald marked this pull request as ready for review August 26, 2022 06:51
@taylorotwell taylorotwell merged commit d6d92eb into laravel:master Aug 29, 2022
@timacdonald timacdonald deleted the make-invokable-rules-default branch September 15, 2022 05:37
taylorotwell pushed a commit that referenced this pull request Oct 12, 2022
PR #44016 re-added the `--invokable` option to the `MakeRuleCommand` after it was removed by PR #43868

As Invokable rules will be the default in 10.x, this PR removes this option again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants