Download the PHP package hypathbel/model-scribe without Composer
On this page you can find all versions of the php package hypathbel/model-scribe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hypathbel/model-scribe
More information about hypathbel/model-scribe
Files in hypathbel/model-scribe
Package model-scribe
Short Description A driver-based Eloquent audit log package for Laravel — log model activity to database, files, or custom targets.
License MIT
Homepage https://github.com/hypathbel/model-scribe
Informations about the package model-scribe
ModelScribe ✍️
ModelScribe is a powerful, driver-based audit log package for Laravel. It allows you to effortlessly record every change in your Eloquent models and route them exactly where they need to go: a database table, a flat file, multiple targets simultaneously (stack), or custom targets like ELK or Webhooks.
Unlike other packages, ModelScribe excels at multi-table routing, allowing you to logically separate logs for different business domains into different database tables or even different connections.
✨ Features
- Eloquent Integration: Simple trait-based setup.
- Multi-Target Drivers: Support for
database,file, andstack(log to multiple places at once). - Multi-Table Routing: Map different models to different log tables or database connections.
- Deep Diffing: Records
oldvsnewattributes automatically. - Customizable Retention: Choose between
permanent,days-based, orrotating(keep N records per table). - Rich Context: Automatically captures URL, IP Address, User Agent, and the authenticated "causer".
- Batching: Group related operations with a unique
batch_uuid. - Developer Friendly: Clean API, Facades, and a prune command.
🚀 Installation
Install the package via composer:
Publish the configuration and migrations:
Run the migrations:
⚙️ Configuration
The config/model-scribe.php file allows you to define your drivers and their behavior.
Database Driver & Multi-Table Stores
You can define multiple "stores" within the database driver. This is perfect for high-traffic apps that want to keep order logs and invoice logs in separate tables.
Generate a migration for a new store:
🛠️ Usage
1. Basic Auditing
Add the HasAuditLog trait to your Eloquent model.
2. Customizing Events and Attributes
By default, ModelScribe logs created, updated, and deleted. You can customize this per model.
3. Manual Logging
Sometimes you want to log actions that aren't tied to an Eloquent lifecycle.
🧹 Maintenance (Pruning)
Keep your log tables lean. ModelScribe includes a prune command that respects the retention policy defined in your config.
🧪 Testing
📜 License
The MIT License (MIT). See License File for more information.
All versions of model-scribe with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0