owenvoke/cachent
Cachent is a lightweight Laravel package by Owen Voke that provides simple, expressive caching helpers, making it easy to store and retrieve cached values with minimal boilerplate while keeping your application fast and responsive.
Before anything else, verify what you are installing. The package's one-line description ("a secure, open source torrent cache") does not match the detailed feature list (a fluent Laravel client for the Cachet status page API: components, incidents, metrics, schedules, facade + DI, API token/basic auth). Check composer.json and the src/ tree after install and confirm the namespace is OwenVoke\Cachent. Everything below assumes the Cachet-client interpretation, which is the one the documented surface area supports.
Install at the patched version.
composer require owenvoke/cachent:^2.2.1
composer dump-autoload -o
Do not pin 2.2.0 — v2.2.1 exists solely to fix a file that was missing from that distribution.
Publish the config and read it end to end.
php artisan vendor:publish --provider="OwenVoke\Cachent\CachentServiceProvider"
Run it interactively the first time so you can see the real tag names; then note the actual filenames and keys in config/. The keys you care about are the base URL of your Cachet instance, the credential (API token preferred, basic auth as fallback), and any timeout/retry setting.
Keep credentials in .env only. Whatever the published keys are named, mirror them into env vars and reference them via env() in the config file. Never commit a token; a status page token is a write credential over your public incident history.
Confirm the binding before writing application code. Resolve the client from the container in php artisan tinker and hit a read-only endpoint (list components). This proves URL, auth, TLS, and network egress from your environment in one step, before you build any logic on top.
Where to look first: the published config, then the service provider (to see how the client is bound and whether it is a singleton), then the resource classes for components/incidents — those tell you the exact method names and payload shapes, which are the only API you actually need.
First use case: a deploy- or health-check-driven incident. A scheduled command (or a failed-job handler) opens an incident on your Cachet page when a health probe fails, and resolves it once the probe passes. This is the highest-value, lowest-risk integration: it is read-mostly, it fails safely, and it is immediately visible to stakeholders.
StatusPage wrapper class that takes the client via constructor injection, exposes domain methods (openIncident(), resolveIncident(), pushMetric()), and swallows/translates exceptions. Controllers, jobs, and commands all depend on your wrapper, not the package. This is your seam for testing and for swapping the package out later.STATUS_PAGE_ENABLED flag checked at the top of the wrapper, defaulting to false locally and in CI. You do not want a developer's test run creating incidents on the production status page.investigating → identified → watching → fixed). Store the returned incident ID (a small settings table or a cache key like status:incident:{service}) so later updates target the same incident instead of opening a new one.Cache::lock() or a "current incident" record check; only open when there is no open incident for that component.tries/backoff. A slow or unreachable status page must never add latency to a deploy or a request. Use ShouldBeUnique on the job to collapse duplicate pushes.try/catch (\Throwable), log with context (component, incident ID, response status), and return a null/false result. The status page is a reporting channel; it is never allowed to be the reason a deploy fails.phpunit.xml set the enabled flag to false and bind a fake implementation of your wrapper in the container. For the wrapper's own tests, mock the HTTP layer (Laravel's Http::fake() if the client is built on the HTTP client; otherwise the underlying Guzzle mock handler) and assert the outgoing payload, not just that a method was called.status:sync command that pushes your real component states is cheap insurance against drift caused by manual edits in the Cachet UI.composer.json for the supported PHP/Laravel matrix — don't assume your version is in range.composer clear-cache, delete vendor/owenvoke/cachent, reinstall, composer dump-autoload -o, php artisan optimize:clear. Also confirm your deploy pipeline isn't caching the vendor directory or skipping package discovery.bootstrap/cache/config.php generated before the upgrade will mask changed defaults. Always php artisan optimize:clear before comparing behaviour before/after. And do not blanket vendor:publish --force in production — diff the config, merge deliberately, then config:cache.vendor/. If you need different key/URL/status mapping behaviour, extend your own wrapper or rebind an implementation in a service provider. Anything patched in vendor/ disappears on the next composer update — that class of mistake is exactly what a "missing file" patch release exposes in a dependency.php artisan about and php artisan tinker for a live client check, Http::fake()/mock handler for payload inspection, php artisan config:show after publishing, and structured logging of request/response on every outbound call during rollout. Log the incident ID on both create and update so you can trace a lifecycle end to end.How can I help you explore Laravel packages today?