Skip to content

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

PageSignatureUse when
OverviewWorkflows and command index
cache:clearmodularous:cache:clearInvalidate all or targeted module/route caches
cache:warmmodularous:cache:warmPre-populate after deploy or clear
cache:warm-presentationmodularous:cache:warm-presentationPre-warm public presentationItem URL caches
cache:purge-presentationmodularous:cache:purge-presentationPurge public presentationItem filesystem caches
cache:statsmodularous:cache:statsInspect key counts per module
cache:graphmodularous:cache:graphShow, rebuild, or analyze relationship graph
cache:versionsmodularous:cache:versionsPrint cache version counters
cache:listmodularous:cache:listList 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 MyModule

After deploy

bash
php artisan modularous:cache:clear
php artisan modularous:cache:warm
php artisan modularous:cache:versions

Debug 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=10

Inspect cross-module invalidation

bash
php artisan modularous:cache:graph show
php artisan modularous:cache:graph stats --format=json
php artisan modularous:cache:stats --graph

cache: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
OptionClears
--countsFilter badge caches
--indexPaginated list caches
--recordsSingle record caches
--formattedItemsTable row formatting caches
--formItemsEdit 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,category

Align warm flags with enabled types in config — warming disabled types has no effect.

cache:graph Actions

ActionPurpose
show (default)Display relationship graph
rebuildRescan modules after new HasCaching entities or routes
statsGraph statistics
analyzeImpact for a specific --model or table

Run rebuild after adding modules to cache.modules or changing getEloquentRelationships() on entities.

See Also