Module Route Cache — Console Commands
Artisan commands for clearing, warming, inspecting, and rebuilding module-route cache live under Cache Commands. They wrap ModularousCacheService and complement Flush commands.
Command Reference
| Page | Signature | Use when |
|---|---|---|
| Overview | — | Workflows and command index |
| cache:clear | modularous:cache:clear | Invalidate all or targeted module/route caches |
| cache:warm | modularous:cache:warm | Pre-populate after deploy or clear |
| cache:warm-presentation | modularous:cache:warm-presentation | Pre-warm public presentationItem URL caches |
| cache:purge-presentation | modularous:cache:purge-presentation | Purge public presentationItem filesystem caches |
| cache:stats | modularous:cache:stats | Inspect key counts per module |
| cache:graph | modularous:cache:graph | Show, rebuild, or analyze relationship graph |
| cache:versions | modularous:cache:versions | Print cache version counters |
| cache:list | modularous:cache:list | List file-cache entries (hidden command) |
Common Workflows
Enable a new cached module
bash
php artisan modularous:cache:graph rebuild
php artisan modularous:cache:warm MyModule MyRoute --counts --formattedItems
php artisan modularous:cache:stats MyModuleAfter deploy
bash
php artisan modularous:cache:clear
php artisan modularous:cache:warm
php artisan modularous:cache:versionsDebug stale admin data
bash
php artisan modularous:cache:stats PressRelease --keys --deps
php artisan modularous:cache:graph analyze --model=PressRelease
php artisan modularous:cache:clear PressRelease PressRelease --formattedItems
php artisan modularous:cache:warm PressRelease PressRelease --formattedItems --limit=10Inspect cross-module invalidation
bash
php artisan modularous:cache:graph show
php artisan modularous:cache:graph stats --format=json
php artisan modularous:cache:stats --graphcache:clear Options
Target specific cache types per route:
bash
php artisan modularous:cache:clear Blog Post --index
php artisan modularous:cache:clear Blog Post --counts --formattedItems --formItems| Option | Clears |
|---|---|
--counts | Filter badge caches |
--index | Paginated list caches |
--records | Single record caches |
--formattedItems | Table row formatting caches |
--formItems | Edit form payload caches |
cache:warm Options
bash
php artisan modularous:cache:warm Blog Post --counts
php artisan modularous:cache:warm Blog Post --formattedItems --limit=100
php artisan modularous:cache:warm Blog Post --items --eager=author,categoryAlign warm flags with enabled types in config — warming disabled types has no effect.
cache:graph Actions
| Action | Purpose |
|---|---|
show (default) | Display relationship graph |
rebuild | Rescan modules after new HasCaching entities or routes |
stats | Graph statistics |
analyze | Impact for a specific --model or table |
Run rebuild after adding modules to cache.modules or changing getEloquentRelationships() on entities.
Related System Reference
- ModularousCacheService
- CacheRelationshipGraph
- Flush overview — broader runtime flush (
flush,flush:sessions)
See Also
- Warmup — what happens inside warm commands
- Invalidation — observer vs manual clear
- Per-Module Setup — when to run graph rebuild