Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Time Ago Bundle

Time Ago Bundle Laravel Package

softspring/time-ago-bundle

Softspring TimeAgoBundle adds a simple Twig filter for rendering dates and timestamps as human-friendly relative time, such as “5 minutes ago” or “2 days ago.” It helps Symfony applications show compact, readable age labels in templates without custom date logic.

View on GitHub
Deep Wiki
Context7

This bundle provides a simple twig extension to human readable date diff based on translations

Frequently asked questions about Time Ago Bundle
What does softspring/time-ago-bundle do?
It is a lightweight Symfony bundle that renders human-readable relative timestamps such as "3 minutes ago" or "2 days ago" in Twig templates. It wraps a configurable time-ago formatter behind a Twig extension so you avoid writing repetitive date-diff logic in controllers. Output formats and translations can be customised, and the underlying formatter is also callable from plain PHP.
Can I use softspring/time-ago-bundle in a Laravel application?
Not cleanly. It is a Symfony bundle, so it ships a dependency-injection extension and a Twig extension, and Laravel has no bundle model, no compiler passes and no Twig runtime by default. Adopting it means pulling Symfony DependencyInjection, HttpKernel and Twig transitively into an app that otherwise does not use them, or stripping the bundle wiring and consuming only the formatter class. For most Laravel teams Carbon::diffForHumans is the better answer.
How do I install and register softspring/time-ago-bundle?
Install it with Composer and, in a Symfony application, enable the bundle in config/bundles.php so its DI extension and Twig extension are registered automatically. No manual service wiring is normally needed because the container handles it. If you are testing it inside Laravel, expect to register a service provider yourself or bypass the bundle entirely.
How do I render a relative timestamp in a Twig template?
Apply the time_ago filter to any value implementing DateTimeInterface, for example {{ post.createdAt|time_ago }}, which outputs a string such as "2 days ago". The filter handles the diff calculation for you, so templates stay free of date arithmetic. The same formatter can be called directly from PHP services if you need the string outside a template.
How do I configure the time-ago output formats and translations?
Configuration lives in the bundle's config section, where you can adjust the output format and translation strings used for the relative labels. Because output text is translation-driven, you can localise phrases like "just now" or "X days ago" per locale. Check the bundle's config tree in the tagged release before relying on specific keys, since the 5.6.0 notes do not enumerate configuration changes.
Which PHP and Symfony versions does this package support?
It targets the Symfony 5, 6 and 7 line, but the exact PHP and Symfony floors after the 5.6.0 release are not documented in the release notes. Read the require block in composer.json at the tag you intend to pin rather than inferring from the version number. If you are evaluating it for Laravel, the transitive Symfony component constraints are the most likely source of dependency conflicts.
What is the Laravel-native alternative to this package?
Carbon::diffForHumans is already in your dependency tree through illuminate/support and Eloquent, and it produces the same class of relative output with locale and timezone support. You can expose it as a Blade directive or a model accessor in a few lines, with no extra packages. Reach for the bundle itself only if a spike proves its formatter is framework-agnostic and its output genuinely differs in a way your product cares about.
What changed in version 5.6.0, and is it safe to upgrade?
The 5.6.0 release notes are a bare compare link from v5.5.10 to v5.6.0 with no changelog body, no migration notes and no deprecation notices. A patch-to-minor bump implies additive, non-breaking changes under semver, but that is inference rather than evidence. Diff the two tags before upgrading, and pin an exact version rather than floating the constraint on a package with a blank changelog.
Can the time-ago formatter be used standalone without Symfony DI or Twig?
This is unverified and is the deciding question for any non-Symfony integration. If the formatter is a plain class with no container or Twig coupling, a Laravel service provider can bind it and a Blade directive can wrap it in roughly a day of work. If it is container-aware or Twig-coupled, the integration cost rises sharply for a feature that is a one-line Carbon call.
How should I evaluate this package before using it in production?
Run a timeboxed spike of no more than two days: install it in a throwaway app, strip the bundle wiring, and confirm the formatter instantiates on its own. Compare its output against Carbon::diffForHumans and against a small internal helper before deciding to buy rather than build. If you do adopt it, wrap it behind a first-party interface so the dependency can be swapped without touching call sites, and verify release cadence, security advisory handling and license terms first.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core