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
Laravel Time Helpers

Laravel Time Helpers Laravel Package

mateusjunges/laravel-time-helpers

Laravel Time Helpers adds handy date and time utilities to Laravel apps: Carbon macros, timezone conversion, and human-friendly formatting. Replace repetitive, error-prone date logic with clean, readable helpers that keep your code simple.

View on GitHub
Deep Wiki
Context7

This package provides two simple functions to get future and past times.

Frequently asked questions about Laravel Time Helpers
How do I install mateusjunges/laravel-time-helpers?
Install it with Composer using composer require mateusjunges/laravel-time-helpers. The package targets Laravel applications on PHP 8.0 or newer, and Laravel package discovery handles the service provider automatically. Install it in a branch and check for dependency conflicts before rolling out.
What Laravel and PHP versions does laravel-time-helpers support?
Version 1.1.0 requires PHP ^8.0 and targets Laravel 9, while dropping PHP 7.4 and Laravel 7. Confirm the exact Laravel 8 constraint in the package composer.json before assuming a broad upgrade path. Applications on older versions should remain pinned to v1.0.1 until they upgrade.
What features does laravel-time-helpers add to Laravel?
It provides two simple helper functions for getting future and past times, along with Carbon macros, timezone conversion, and human-friendly formatting. The goal is to replace repetitive date logic with clean, readable calls. It is a small convenience utility rather than a full date/time abstraction layer.
How do I get a future or past time with laravel-time-helpers?
The package exposes two simple helper functions, one for future times and one for past times, which return Carbon instances you can chain or format. Check the repository README for the exact function names and accepted arguments before wiring them into your code. Keep any date-sensitive logic covered by application tests.
Does laravel-time-helpers handle timezones and daylight saving time?
The package provides timezone conversion and is built on Carbon macros, so behavior follows Carbon's timezone and DST handling for your installed version. Timezone and DST edge cases can vary across Carbon versions, so add regression tests for any date-sensitive feature. Do not assume the helpers fully solve locale or DST semantics for critical scheduling or billing logic.
Why did laravel-time-helpers v1.1.0 drop Laravel 7 and PHP 7.4?
Version 1.1.0 is primarily a compatibility and dependency-floor update that raises the PHP requirement to ^8.0 and adds Laravel 9 support. That change intentionally ends support for Laravel 7 and PHP 7.4. Upgrade PHP and Laravel first, then update the package and run date/time regression tests.
Is laravel-time-helpers safe to use in production?
Runtime risk is low because the package is a thin convenience layer over Carbon with little architectural coupling. The main risks are timezone, DST, and locale semantics in date-sensitive paths, plus Composer conflicts during upgrades. Use it freely in non-critical display logic, but add explicit regression tests before using it in scheduling or billing workflows.
How should I test date logic that uses laravel-time-helpers?
Freeze time in your tests with Carbon::setTestNow or Laravel's travel helpers so future and past calculations are deterministic. Cover timezone, DST, and locale cases that matter to your application, especially around scheduling and billing. Because the helpers delegate to Carbon, rerun your suite after any Carbon or Laravel upgrade.
Is mateusjunges/laravel-time-helpers actively maintained and does it support Laravel 10?
The v1.1.0 release is a compatibility and dependency-floor update that adds Laravel 9 support and requires PHP 8.0 or newer. Laravel 10+ support is not confirmed in the available evaluation, so check the repository and composer.json before upgrading. Monitor release cadence and maintainer responsiveness if you depend on the package long term.
What are alternatives to laravel-time-helpers?
Laravel's built-in now(), today(), and Carbon's own add and sub methods cover most of the same use cases without an extra dependency. Other Laravel date packages or your own custom helpers are options if you need broader formatting or timezone features. Treat this package as a convenience dependency when its terse helpers genuinely reduce repetitive date code.
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