Download the PHP package mahedulhasan/audit-logger without Composer
On this page you can find all versions of the php package mahedulhasan/audit-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package audit-logger
AuditLogger
A simple Laravel Audit Logging Package to track database changes on your models.
Tracks create, update, delete events and stores only the changed fields in audit_logs table.
Features
- Logs
created,updated, anddeletedevents automatically - Only stores changed fields (
old_values&new_values) on updates - Tracks which user made the changes
- Stores client IP address
- Dynamic observer attachment for all or selected models
- Bootstrap-based view to display audit logs
- Easy to integrate as a Laravel package
Requirements
- Laravel 9 / 10
- PHP >= 8.1
- MySQL or any database supported by Laravel
Installation
Require the package via Composer:
Make sure your
minimum-stabilityincomposer.jsonallowsdevpackages if needed:
Run the migrations:
(Optional) Publish views/config if you want to customize:
Development Version (GitHub)
If you want to use the latest development version, install directly from GitHub:
-
Add the VCS repository to your project's composer.json:
- Require the dev-main branch:
Usage
Observer
The package automatically attaches AuditObserver to your models.
To attach manually:
Display Audit Logs
Visit the route:
This route displays a Bootstrap table showing:
- User
- Event (Created / Updated / Deleted)
- Model & ID
- Changed fields (old → new)
- IP Address
- Timestamp
Note: The route is automatically registered by the package's ServiceProvider.
Development
- Add new migrations in
database/migrations/ - Add additional observers in
src/Observers/ - Update views in
resources/views/ - Run
composer dump-autoloadif you add new namespaces
Notes
- No local installation needed. The package can be installed directly via Composer.
- Ensure ServiceProvider is registered automatically via
extra.laravel.providersincomposer.json. - Migrations, routes, and views are loaded automatically. You only need to run
php artisan migrate.
License
MIT License © [Mahedul Hasan]