Installation
Requirements
- PHP >= 8.2
- Laravel 11 or 12
Install via Composer
composer require graymatter/laravel-audit-chain
Publish Config & Migration
Publish the configuration file and migration:
php artisan vendor:publish --tag="audit-chain-config" php artisan vendor:publish --tag="audit-chain-migrations"
Run Migrations
php artisan migrate
This creates the audit_logs table with all required columns for both activity logging and full audit trail modes.
Environment Setup
For production use with audit trail mode, set a secret chain seed in your .env:
AUDIT_CHAIN_SEED=your-random-secret-value-here
Important: The chain seed is used to compute the genesis hash — the first link in the cryptographic chain. A predictable seed weakens tamper-evidence guarantees. Generate a random value using
php artisan tinker --execute="echo Str::random(64);".
What's Next?
Once installed, head to Configuration to customize the package, or jump straight to the Quickstart to see it in action.