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

Clock Laravel Package

jeckel-lab/clock

A small clock abstraction for Laravel and PHP that lets you control and freeze time in tests. Swap the system clock for a fake one to make time-dependent code deterministic, while production code keeps using the real clock.

View on GitHub
Deep Wiki
Context7

PHP Clock abstraction

Frequently asked questions about Clock
What is jeckel-lab/clock used for in Laravel applications?
It provides a small Clock abstraction so application code can depend on an injected clock instead of calling now() directly. In tests you can swap in a fake clock and freeze, travel, or advance time deterministically. Production code keeps using the real system clock while tests avoid sleeping or mocking Carbon.
How do I install jeckel-lab/clock in a Laravel app?
Install it with Composer using the package name jeckel-lab/clock. The package is described as having Laravel container-binding integration, so confirm whether service provider auto-discovery applies or whether you must register a provider manually. Check the package README and composer.json for the exact PHP and Laravel constraints before adding it to your application.
Do I need to configure jeckel-lab/clock after installation?
The provided overview emphasizes a minimal API and container binding rather than publishable configuration or migrations. In a typical Laravel setup you bind the real clock for production and swap in a fake clock for tests. Verify the exact binding names and any optional setup steps in the package README.
Which Laravel and PHP versions does jeckel-lab/clock support?
The exact Laravel and PHP support matrix is not specified in the supplied context. Review the package composer.json constraints and the 1.2.0 release diff, then test resolution against both your current and next Laravel target. Do not assume minor-version compatibility without confirming the declared constraints.
How do I freeze or advance time in tests with jeckel-lab/clock?
Swap the real Clock binding for a fake clock in your Laravel test setup, then use the package's freeze, travel, advance, or reset operations as documented. Because dependent code receives the clock through dependency injection, it observes the controlled time without sleeping or Carbon mocking. Reset the clock after each test to avoid leaking frozen time into other tests.
Does jeckel-lab/clock work with Carbon?
Yes, the package is described as returning Carbon-compatible current-time values. That means code that expects a Carbon instance for the current time can still work while the clock itself is injectable and swappable. The fake clock controls the value that Carbon-compatible consumers receive during tests.
Is jeckel-lab/clock safe to use in production?
It is a lightweight abstraction intended to keep production on the real system clock while making tests deterministic. Before production use, pin the version, run license and advisory scans, and review the 1.2.0 diff because the supplied assessment notes empty release notes. Confirm maintainer activity and supported Laravel versions rather than relying only on the minor version number.
How is jeckel-lab/clock different from calling now() or using Carbon::setTestNow()?
Calling now() directly hides a time dependency, while this package makes time an explicit injected dependency through a Clock contract. Carbon::setTestNow() can control global test time, but a swappable clock keeps the test seam at your own service boundary. That generally makes time-dependent code easier to reason about and less coupled to global static state.
What are the maintenance and upgrade risks for jeckel-lab/clock 1.2.0?
The supplied assessment says no package metadata, repository changelog body, or release notes were available, and the 1.2.0 notes payload was empty. Treat the minor version as semver intent rather than a guarantee and inspect the actual diff before upgrading. Pin the version, identify an internal owner, and monitor release cadence and Laravel compatibility.
How costly would it be to remove jeckel-lab/clock later?
Removal should be relatively contained because the package is an abstraction rather than a data-owning component, and the overview does not mention migrations or tables. Adopt it behind a thin internal adapter or interface so your application depends on your own abstraction, not directly on the package everywhere. Replacing the container binding with your own Clock implementation then becomes the main migration task.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
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