PHPackages                             tofiq/laravel-audit-trail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tofiq/laravel-audit-trail

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tofiq/laravel-audit-trail
=========================

v0.1.0(1y ago)05MITPHPPHP ^8.0

Since Feb 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Tefoh/laravel-audit-trail)[ Packagist](https://packagist.org/packages/tofiq/laravel-audit-trail)[ RSS](/packages/tofiq-laravel-audit-trail/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Introduction
------------

[](#introduction)

***Laravel Audit Trail*** is a package that logs all SQL queries executed by your Laravel application, whether they originate from Eloquent Models or the Query Builder.

This package allows you to track query history effortlessly, requiring no modifications to your project beyond the initial setup. Once configured, all database interactions are automatically logged.

Installation
------------

[](#installation)

To install the package, run the following command via [Composer](https://getcomposer.org/download/).

```
composer require tofiq/laravel-audit-trail
```

After installation, publish the package configuration using:

```
php artisan vendor:publish --provider=Tofiq\\AuditTrail\\AuditTrailServiceProvider
```

This will generate a configuration file (config/audit-trail.php), where you can customize the package settings, also the necessary migration.

Then if you want to use the database trailer then run this as well:

```
php artisan migrate
```

---

Customizations
--------------

[](#customizations)

#### Using a Custom Eloquent Model

[](#using-a-custom-eloquent-model)

By default, Laravel Audit Trail stores logs in a database table. If you prefer to use a custom Eloquent model for audit logs, define it in the `audit-trail.php` configuration file:

```
