laravel-validation-rules/timezone
Validate timezone input in Laravel with a dedicated timezone rule that checks values against PHP's supported timezone identifiers. Drop it into form requests or inline validators for a clear, reusable alternative to regex guessing.
in_array checks scattered through form requests.Europe/*, or only the zones your support team can staff). That's a product decision ("we launch in EU + NA first") expressed as a validation rule rather than a support-process promise.DateTimeZone::listIdentifiers(). Buy only when you want the area/group/abbreviation constraints, or when you want consistency with the rest of the laravel-validation-rules/* family already in the codebase. If your need is the single "is this a valid identifier" check, note that Laravel ships a built-in timezone rule — do not add a dependency for that alone.Adopt when:
<select> you control.DateTimeZone group — the genuine differentiator over the built-in rule.laravel-validation-rules/* family and want one idiom for all of them.Look elsewhere (or do nothing) when:
timezone rule and skip the dependency.brick/date-time or a dedicated tzdata package instead.On release 1.7.0: a minor bump with no documented breaking changes, deprecations, or new features in the notes. Treat as routine maintenance — pin to ^1.7, skim the diff for Laravel/PHP support-matrix and dependency changes, and re-run your validation test suite. Low adoption risk, but the empty changelog is itself a signal: this is a small, single-maintainer utility. Budget for the possibility of reimplementing the two or three rules you actually use (an afternoon) as your exit plan.
To executives: A free, MIT-licensed, single-purpose validation package that closes a specific data-quality hole — invalid or unsupported timezones being written into the product and silently corrupting schedules, reminders, and reports. Cost is one Composer dependency; downside is bounded because the functionality is small enough to replace in-house if the package ever stalls. No vendor lock-in, no licensing cost, no infrastructure change. The business value is narrower blast radius when we launch local-time features in new regions.
To engineering: One composer require, zero configuration, no service provider to register, no runtime cost beyond a lookup against PHP's own timezone list. Rule objects compose into existing Form Requests and can be unit-tested like any other rule. Use it for area/group-scoped constraints and imports; use Laravel's built-in timezone rule where scope is irrelevant; use Carbon for anything involving actual time math. Current release (1.7.0) is a minor bump with no breaking changes — pin it and move on.
How can I help you explore Laravel packages today?