kachnitel/duration-bundle
A Laravel/PHP package for working with and formatting durations, helping you convert time values into readable strings and handle duration logic cleanly in your applications.
HH:MM vs MM:SS, mixed human-readable input, negative/zero edge cases, seconds overflow at 60, DateInterval interop). This package is a credible "buy" — or rather "adopt" — answer to a recurring ticket class, letting you redirect engineering time toward differentiators.hhmm, seconds, human-readable) plus Twig filters lets design settle on one display convention rather than each squad inventing its own. That is a product-quality lever, not just a code-quality one.Adopt when:
DurationType form type are Symfony form/Twig ecosystem artifacts, not Laravel-native. If this is truly a Laravel application, expect integration work: Blade directives instead of Twig filters, and adapters around the form type. Confirm the framework fit before committing; the framing as a "Laravel/PHP package" does not match the shipped surface.0.0.x API surface: pin the version, wrap the calls behind your own thin service or facade, and avoid letting DurationUtil leak into domain code.Look elsewhere when:
diffForHumans/interval formatting may cover 80% of the need with zero new dependency.0.0.1 is a supply-chain and longevity risk for that class of code.To executives: This is a small, low-cost dependency that removes a recurring category of defects — durations displayed or parsed inconsistently across screens. It is not a platform bet. Value is modest but real: faster delivery on time-related features and fewer user-facing inconsistencies. Risk is contained if we pin the version and isolate it behind our own interface, so we can swap it out cheaply.
To engineering: Scope it honestly — despite the "Laravel/PHP" framing, this ships Symfony forms and Twig, so Laravel teams are looking at adapter work, not drop-in use. What it does give us is a tested DurationUtil covering multi-format parsing, toSeconds, hhmm output, and DateInterval conversion, with CI and real docs — better than rolling our own for the third time. Recommendation: adopt behind a thin internal wrapper, limit to non-critical paths, and revisit at 1.0 or at the first sign of maintenance stall.
How can I help you explore Laravel packages today?