Laravel 12.44 introduces fluent date validation helpers on the Rule facade, replacing string-based date comparisons with self-documenting method calls.
Validating dates relative to the current time previously required writing string rules like date|before:now or date|after_or_equal:today.
Laravel 12.44 adds readable method builders under Rule::date():
use Illuminate\Validation\Rule;
$request->validate([
// Must be strictly in the past
'logged_at' => [
'required',
Rule::date()->past(),
],
// Must be strictly in the future
'scheduled_at' => [
Rule::date()->future(),
],
// Must be current timestamp or past
'completed_at' => [
Rule::date()->nowOrPast(),
],
// Must be current timestamp or future
'expires_at' => [
Rule::date()->nowOrFuture(),
],
// Standard date-time format builder (Y-m-d H:i:s)
'published_at' => [
Rule::dateTime(),
],
]);
- Replaces hardcoded string rules with IDE-auto-completable methods
nowOrPast()andnowOrFuture()handle inclusive boundary checks cleanlyRule::dateTime()standardizes database timestamp format validation
Related Tips
View all tips →Render Multiple Field Validation Errors with Flux UI and Blade
Suppress default single-error tooltips in Flux UI components and iterate over all validation messages per field using Blade error directives.
Optimize Large Wildcard Array Validation in Laravel 13.24
Laravel 13.24 introduces dramatic performance optimizations for validating large nested arrays with wildcard rules, reducing validation execution time from 85 seconds to under 1 second.