- How do I add cache tags to Laravel file and database cache drivers?
- Install dragon-code/laravel-cache, which extends Laravel's cache layer with tag support for every cache driver, including file and database stores that do not support tags natively. Use Cache::tags([...]) with put(), get(), and flush() as you would with Laravel's native tagged cache. It uses your existing Laravel cache configuration and requires no extra services.
- How do I install dragon-code/laravel-cache in a Laravel app?
- Install it via Composer; the package supports Laravel auto-discovery, and no migrations or config publish are expected. Confirm the exact require line and PHP/Laravel constraints in the package's composer.json before adding it to production. In a standard Laravel app, a competent engineer can spike it in under a day.
- Which Laravel versions does dragon-code/laravel-cache support?
- Release 4.2.0 declares Laravel 13 support. The available context does not fully spell out the PHP floor or whether Laravel 11 and 12 remain supported, so check composer.json and the CI matrix before upgrading. Map that support matrix against your current and next Laravel upgrade targets.
- Is dragon-code/laravel-cache a drop-in replacement for Laravel's Cache facade?
- It is designed as a drop-in Cache facade integration that preserves the familiar tags(), put(), get(), and flush() methods. It is a thin ergonomics layer over Laravel's cache repository rather than a new infrastructure or persistence layer. Review its service provider for any facade alias or global helper registration that could collide with framework symbols.
- Can dragon-code/laravel-cache handle multiple cache stores and per-store TTLs?
- It uses your existing Laravel cache configuration, so store selection follows your config/cache.php setup rather than a package-specific configuration file. Tagged caching is intended for non-tag drivers such as file and database. Confirm per-store TTL and default TTL behavior in the package docs or tests, because divergent TTL semantics are a silent-risk area.
- What are the production risks of using dragon-code/laravel-cache?
- The highest-severity risk is silent semantics drift, such as divergent default TTLs, null handling, key normalization, or serialization, because failures can be hard to notice. Watch for possible Cache facade alias or global helper collisions that can cause hard-to-diagnose autoload-order failures. Keep it out of domain code and wrap it behind an adapter so removal stays cheap.
- How does dragon-code/laravel-cache compare to Cache::remember in Laravel?
- Native Cache::remember, Cache::flexible, and Cache::rememberForever cover many common caching needs without an extra package. This package competes with those framework-native APIs by adding tag support for non-tag drivers, not by adding a new cache capability in 4.2.0. It fits best where you have many ad-hoc cache call sites and need file or database tag invalidation.
- Is dragon-code/laravel-cache actively maintained?
- It is a small-footprint package with roughly 70 stars and near-zero dependents, backed by a single maintainer, TheDragonCode / andrey-helldar. Release 4.2.0 is maintainer-authored, which is a positive signal, but it does not remove maintainer concentration risk. Check issue response times and the CI matrix for evidence against your exact Laravel minor.
- How do I test code that uses dragon-code/laravel-cache?
- Because it preserves the Cache facade API, exercise it through Laravel's normal cache testing approach and assert tags, put, get, and flush behavior in feature tests. Use a test cache store configured for your testing environment, and clear tagged entries between tests. Check the package's CI matrix for evidence it is tested against your exact Laravel minor, not just the Laravel 13 declaration.
- What does the Smart Cache rebrand mean for dragon-code/laravel-cache?
- Release 4.2.0 rebrands the package as Smart Cache in the README and banner. A package rebrand can be a leading indicator of a possible Composer package rename or namespace change in a future major release. Check the repository for a rename announcement, a transitional package, or a changed composer.json name before planning upgrades.