bitandblack/duration
bitandblack/duration provides a small PHP/Laravel utility for working with time spans: create, parse, and format durations in a readable way, convert between units, and simplify common duration calculations for apps, jobs, and reports.
Duration::create(3, 'months')).DateTime arithmetic or ad-hoc string manipulation.luxon or date-fns).Carbon or DateInterval for your needs.For Executives:
"This package standardizes how we handle time intervals—like subscriptions or task deadlines—with simple, maintainable code. For example, instead of manually calculating ‘30 days from now,’ we’d use Duration::create(30, 'days'). It’s a low-risk way to reduce bugs and dev time, saving costs on custom development while keeping our time-based features scalable."
For Engineering: *"A lightweight, OOP wrapper for durations that:
Duration::add($duration1, $duration2)).Carbon or DateTime.For Design/UX: "This ensures durations are displayed consistently (e.g., ‘2h 30m’ vs. ‘150 minutes’) across logs, UIs, and APIs, improving user clarity and reducing support requests for time-related issues."
How can I help you explore Laravel packages today?