Tamper-evident
SHA-256 hash chain — any tampering is instantly detectable. Eloquent logs are write-protected.
SHA-256 cryptographic hash chain on your Eloquent models. Know who changed what, when — and prove it.
use GrayMatter\AuditChain\Concerns\HasAuditTrail;
use GrayMatter\AuditChain\Contracts\Auditable;
class Order extends Model implements Auditable
{
use HasAuditTrail;
}
// Every change is cryptographically chained
$order = Order::create(['status' => 'pending']);
$order->update(['status' => 'shipped']);
Install in seconds
Add a tamper-evident cryptographic chain to your existing Eloquent models.
Install the package
composer require graymatter/laravel-audit-chain
Publish & migrate
php artisan vendor:publish && php artisan migrate
Add the trait
use HasAuditTrail;
Built for security
If someone modifies, deletes or inserts an entry, the chain breaks and the audit:verify command catches it immediately.
SHA-256 hash chain — any tampering is instantly detectable. Eloquent logs are write-protected.
Every change, every user, every timestamp — searchable and exportable.
Artisan command + programmatic API. Automated alerts via email and webhooks.
Use cases
Someone deleted a record. Who? When? Can you prove it?
Every change is chained. Run audit:verify.
The regulator requests a full audit log.
Export the complete chain — verifiable and tamper-evident.
A developer bypassed Eloquent to modify data directly.
The chain breaks. audit:verify catches it instantly.
Features
use GrayMatter\AuditChain\Concerns\HasActivityLog;
class Post extends Model implements Auditable
{
use HasActivityLog;
}
// hash: null, prev_hash: null
// Simple event logging
use GrayMatter\AuditChain\Concerns\HasAuditTrail;
class Order extends Model implements Auditable
{
use HasAuditTrail;
}
// hash: SHA-256, prev_hash: linked
// Tamper-evident and verifiable
Two modes, one package
HasActivityLog for lightweight logging without hashing. HasAuditTrail for the full cryptographic chain. Both share the same API, table, and ecosystem.
Monitor your data integrity in real time. Detect anomalies before they become incidents.
Visualize audit chain status, event volumes, and trends at a glance.
Smart alerts on unusual patterns: mass deletions, off-hours changes, suspicious access.
Automated chain integrity checks with reports and history.
Auditor-ready PDF/CSV reports. NIS2, SOC2, ISO 27001.
View all user actions on an interactive timeline.
Visually compare before/after changes on every audit entry.
Monitoring, external anchoring, compliance reports and more. Get notified at launch.
No spam. Launch notification only.
Add immutable audit trails to your Laravel application in minutes.
$
composer require graymatter/laravel-audit-chain
PHP 8.2+ · Laravel 11 & 12 · MIT License · Alpha