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

Cachent Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Cachent is a Laravel package for caching your application's environment variables, reducing the overhead of parsing the .env file on every request. It stores env values in a cached PHP file and loads them quickly, making it useful for production deployments where configuration is stable.

  • Caches .env values into a fast-loading PHP file
  • Artisan commands to generate and clear the env cache
  • Speeds up application bootstrap by avoiding repeated .env parsing
  • Integrates via Laravel package auto-discovery
  • Simple configuration for controlling cached variables
Frequently asked questions about Cachent
What is owenvoke/cachent and what problem does it solve?
Cachent is a Composer package for Laravel that adds a cache maintenance mode to your application. When enabled, it temporarily bypasses all cache reads and writes so your app never serves or stores stale data. This is useful during deployments, migrations, and debugging sessions where cached values would otherwise get in the way. Disabling the mode returns your application to normal caching behaviour.
How do I install Cachent in a Laravel application?
Install it with Composer using composer require owenvoke/cachent. Laravel's package auto-discovery should register the service provider for you, so no manual provider entry is normally needed. After installing, check the repository README for the exact commands or configuration needed to toggle cache maintenance mode in your version.
How is cache maintenance mode different from Laravel's built-in maintenance mode?
Laravel's built-in maintenance mode takes the whole application offline and serves a maintenance page to visitors. Cachent's cache maintenance mode keeps your application fully running but changes how the cache layer behaves. That means requests still execute normally while cache reads and writes are bypassed. It is a targeted tool for cache-related problems rather than a full downtime switch.
What happens to cache reads and writes while the mode is enabled?
While cache maintenance mode is active, reads are bypassed so your code falls through to the underlying data source. Writes are also skipped, so nothing new is stored in the cache during that window. Once you disable the mode, caching resumes as normal and your application will repopulate entries as they are next requested.
Does Cachent work with any cache driver, such as Redis, Memcached, file, or database?
Cachent is described as bypassing all cache reads and writes, which means it works at the cache layer rather than targeting a specific backend. That makes it driver-agnostic in principle, whether you use Redis, Memcached, the file store, or the database store. As with any package, confirm the behaviour against the driver you actually run in production before relying on it.
Can I use Cachent during deployments and migrations?
Yes, those are the primary use cases the package is designed for. Enabling cache maintenance mode before a deploy or migration prevents stale values from being served and stops half-written data from being cached. After the deploy or migration finishes, disable the mode and normal caching resumes. It is a good fit for scripted release steps where you control the toggle around the risky window.
Do I need to publish a config file or make any configuration changes?
Because the package is small and focused, most setups work out of the box once Composer has installed it. If the package ships a config file, publishing it lets you customise behaviour, but the core feature is simply toggling the maintenance mode. Always refer to the README for your installed version, since configuration options can change between releases.
Should I leave cache maintenance mode enabled in production?
No, it should be treated as a temporary switch for a specific window, such as a deploy, migration, or debugging session. Leaving it on long term effectively disables your cache, which will increase load on your database or upstream services. Enable it deliberately, do the work that requires it, and then disable it so caching returns to normal.
How can I test that cache bypassing is working in my application?
Write a feature test that enables cache maintenance mode, writes a value to the cache, and then asserts the value is not retrievable as expected. You can also assert that reads fall through to your data source while the mode is active. Run the same test with the mode disabled to confirm normal caching behaviour returns. Covering both states makes the feature's behaviour explicit and protects against regressions when you upgrade.
Is Cachent actively maintained, and what are the alternatives?
Cachent is an open source package by Owen Voke, so you can review the code, open issues, and check the repository for recent releases and Laravel version support. If you prefer not to add a dependency, the alternative is to implement the toggle yourself, for example by swapping the cache store or checking a flag around cache calls. The package simply packages that pattern into a reusable, documented feature for Laravel.
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.
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
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect