artur-gajewski/date-converter-bundle
diffForHumans() (e.g., Carbon::parse($date)->diffForHumans()).@carbon in Laravel 10+).twig/twig via Composer, then register the extension in Laravel’s service container.symfony/http-kernel or symfony/dependency-injection to emulate Symfony2’s bundle system (complex).spatie/laravel-activitylog (for activity timestamps) offer superior functionality.diffForHumans()?
// app/Providers/BladeServiceProvider.php
Blade::directive('ago', function ($date) {
return "<?php echo Carbon\\Carbon::parse({$date})->diffForHumans(); ?>";
});
@ago($item->created_at)
{{ date | ago }} and map to Carbon alternatives.ContainerInterface and Bundle system.
strict_types=1 and modern PHP syntax updates.composer.json.diffForHumans() is actively maintained and optimized.Container or Bundle issues) will require deep knowledge of both stacks.dd(), Xdebug).@cache directives).| Risk | Likelihood | Mitigation |
|---|---|---|
| Twig v1.x security vulnerabilities | High | Avoid; use Carbon/Blade instead. |
| Symfony2 dependency conflicts | Medium | Isolate in a separate service provider or container. |
| Template rendering errors | High | Write unit tests for Blade directives; use @if fallbacks. |
| Bundle abandonment | High | Migrate to Carbon ASAP; avoid long-term dependency. |
| PHP version incompatibilities | Medium | Use PHP 8.0+ polyfills or refactor the extension. |
diffForHumans() and Blade directives.How can I help you explore Laravel packages today?