rvxlab/laravel-metronome
Laravel Metronome adds precise sub-minute scheduling to Laravel, letting you run recurring tasks at second-level intervals through a simple, testable API. Use it for polling, heartbeats, and other time-sensitive jobs that need more than cron’s one-minute resolution.
composer require rvxlab/laravel-metronome. Laravel's package auto-discovery registers the service provider — there is nothing to add to config/app.php.php artisan vendor:publish --tag="metronome-config" (confirm the exact tag in the README; the config file itself is the authoritative list of options). Add the credentials to .env and reference them only from config/metronome.php so config:cache works.config/metronome.php → the package's service provider (this shows you the container binding and any singleton/lifecycle decisions) → the facade/class docblocks, which at v1.0.0 are the stable public API surface.php artisan tinker — resolve the client out of the container (app(...) or the facade) and make the smallest possible request. Do this before wiring anything into a controller; it separates credential/config problems from application problems.^1.0 — treat this as the version to build against rather than an interim 0.x.App\Services\Metronome\Client (or an action per operation) that depends on the package client. Every call site depends on your class, not the package's. When the package changes — or when you need to record what you sent — you change one file.tries, backoff, and timeout set explicitly, and ShouldBeUnique or a uniqueness key so the same domain event isn't dispatched twice.toArray()/toPayload() method and unit-test it. Asserting on a DTO is far cheaper than asserting on an HTTP interaction, and it documents the contract you rely on.Http::fake() (or the package's own fake, if it ships one) and assert the request was sent with the expected payload and headers. In unit tests, bind a fake implementation of your wrapper class into the container.compare/v0.1.1...v1.0.0 and check specifically for renamed classes, renamed config keys, and changed default values. The 0.x → 1.0 boundary is exactly where a maintainer is most likely to have tidied names without calling it out in the summary.^1.0, but don't assume forever-stability. From here the package owes you semver, which is a real improvement over 0.x — but keep the diff check in your upgrade routine anyway.env() only inside config files. If you reference env('METRONOME_...') from a service class, it returns null the moment php artisan config:cache runs in deploy. This is the single most common "works locally, broken in staging" cause for wrapper packages.rateLimited() handler on the job; otherwise a burst of queued work turns into a retry storm that makes the throttling worse.php artisan tinker resolve the client — does it construct? (2) dump config('metronome') — are the keys populated post-config:cache? (3) fire the same payload through Http::fake() in a test — is your payload valid? (4) only then look at the package internals. This order isolates config, payload, and transport before you start reading vendor code.How can I help you explore Laravel packages today?