model-scribe:prune for enforcing your retention policy and removing stale audit records, and model-scribe:make-table for scaffolding the database migrations needed when you add a new named log store. Both commands are registered automatically by the package’s service provider — no additional setup is required.
model-scribe:prune
Deletes stale audit log entries from every table managed by the target driver, according to the retention policy set inconfig/model-scribe.php.
Signature
Prune stale ModelScribe audit log entries according to retention policy.
Options
Examples
Output
The command always exits successfully and prints the total number of records removed:permanent, or if the driver does not manage persistent storage (e.g. file), the count will be 0.
For a full explanation of how each driver handles pruning and how to schedule this command, see the Pruning guide.
model-scribe:make-table
Generates a Laravel database migration for an additional ModelScribe log table. Use this whenever you want to route a model’s audit entries to its own dedicated table via a named store. SignatureCreate a migration for an additional ModelScribe log table (store).
Arguments
Options
Examples
Follow-up steps
After running the command, complete the setup in three steps:1
Run the migration
Create the new table in your database:
2
Register the store in config
Open
config/model-scribe.php and add the new store under drivers.database.stores:3
Set $auditLogName on your model
Point the model at the new store by setting All future audit entries for
$auditLogName to match the store key:Invoice will now be written to — and pruned from — invoices_scribe_logs instead of the default table.For the full guide on routing models to named stores, including multi-table stores, guard-based routing, and cross-database configurations, see the Multi-table routing reference.