league/period
League\Period is PHP's missing time range API, offering immutable Interval and Bounds value objects, named constructors, and full support for simple or complex time range logic. Framework-agnostic, documented, and requiring PHP 8.1+.
league/period provides immutable Period, Duration, and Datepoint value objects, named constructors, explicit boundary types (include/exclude start and end), intersection, merge, split, diff, contains, sequence operations, and ISO serialization.[start, end)) and DST-aware splitting—the changelog explicitly fixes DST-related split behavior—reducing edge-case defects in billing, reporting, and scheduling features.DateTimeInterface/Carbon inputs at the edges while domain services use explicit range logic. It does not couple domain code to Eloquent, Carbon, or the framework.DateTimeInterface/DateTimeImmutable and wants immutable value objects, named constructors, and explicit boundary semantics without adopting a large calendar or recurrence framework.league/period as the domain primitive for interval logic in Laravel services and actions. Use immutable Period, Duration, and Datepoint objects; pass DateTimeInterface from Eloquent/Carbon at the edges; keep persistence and presentation out of the domain. Standardize on half-open [start, end) boundaries and document them in specs. Wrap the package in a thin internal adapter so it can be swapped later. Validate DST, month-end, leap-year, and boundary cases in a spike, pin the version, and add contract tests. Use it for intersections, merges, splits, contains, sequences, and ISO serialization instead of duplicating logic across teams.How can I help you explore Laravel packages today?