boralp/laravel-auditable

A lightweight Laravel package to track model changes with IP (binary), deduplicated user agents, and created_by/updated_by auto-fill. Includes export, cleanup, and API endpoints for easy audit history access.

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/boralp/laravel-auditable

1.2.0 2025-09-11 12:57 UTC

This package is auto-updated.

Last update: 2025-10-11 13:09:03 UTC


README

Laravel Auditable is a lightweight, flexible package for tracking changes to your Eloquent models. It automatically logs create and update actions, including:

  • Binary IP storage for fast lookups (IPv4 & IPv6)
  • Deduplicated User-Agent table to save space
  • Automatic created_by / updated_by population
  • Audit logs export to JSON or CSV
  • Retention-based cleanup of old logs
  • API endpoint to fetch model audit history

It’s designed to be easy to install, reusable across projects, and highly configurable via a simple config file.

Features

  • Track who changed a model and when
  • Store IP and User-Agent efficiently
  • Keep your tables clean (no extra columns per model required)
  • Export and archive old logs automatically
  • Optional API endpoint for retrieving audit history
  • Configurable retention period (retention_days)

Installation

composer require boralp/laravel-auditable

php artisan vendor:publish --provider="Boralp\Auditable\AuditableServiceProvider" --tag=config
php artisan migrate