shlogg · Early preview
Paul Redmond @paulredmond

Laravel V10.46 Released With New Enum Validation Methods And More

Laravel v10.46 released with new Enum validation methods, custom rate limiter increments, Conditionable Enum validation rules and more: only() & except() for Enum, increment() method, Conditionable trait with Rule::enum().

The Laravel team released v10.46 this week with new Enum validation methods, incrementing a rate limiter by a custom amount, Conditionable Enum validation rules, and more:
#Enum Validation gets only() and except() methods
@Anton5360 contributed two new methods to the Enum validation rule when you don’t expect all enum cases to be valid:
Rule::enum(ServerStatus::class)    ->only([ServerStatus::Pending, ServerStatus::Active]); Rule::enum(ServerStatus::class)    ->except([ServerStatus::New]);
A status enum is a perfect example of where these methods might be practical: after a record status moves...