Download the PHP package msonowal/laravel-auditor without Composer
On this page you can find all versions of the php package msonowal/laravel-auditor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-auditor
Record your audit activity logs in Mongo DB on on Laravel
A simple package to track, record and log changes of your laravel apps events and also
Eloquent Models by Polymorphic relations. By Default, the Package stores all audit activity
in the audit_logs
collection in the Mongo DB. However you can customize everything via config.
This package uses jenssegers/mongodb for interacting with Mongo DB.
By Default Users Ip address and User Agents are Captured for every request if it is performed by Users.
Installation
The package will automatically register itself.
Configuration
You can optionally publish the config file with:
This is the contents of the published config file:
You can publish the migration with:
Note: The default migration adds the indexes to the collection for the essentials fields however you can modify and tailor upto your needs.
After publishing the migration you can update the indexes on the audit_logs
collection by running the migrations:
Here's a demo of how you can use it:
You can retrieve all activity using the AuditServiceRepository
class.
Inject in your methods
Here's a more advanced example:
Version
According to the composer docs the version:
We will follow the format of X.Y.Z or vX.Y.Z with an optional suffix of -dev, -patch (-p), -alpha (-a), -beta (-b) or -RC. The patch, alpha, beta and RC suffixes can also be followed by a number. Examples:
- 1.0.0
- 1.0.2
- 0.1.0
- 0.2.5
- 1.0.0-dev
- 1.0.0-alpha3
- 1.0.0-beta2
- 1.0.0-RC5
- v2.0.4-p1
Testing After install the dependencies you can run all the tests by excecuting the follow command:
The output should look similar to this:
All the test files should be inside the tests/
directory. Here is an example:
TODO:
Make the model event queable via config Make It more configurable Add Tests
Credits
This package was inspired by their work on spatie/activitylog a package to use log activity in laravel in mysql or supported db by laravel.
Have fun! 🎊
All versions of laravel-auditor with dependencies
illuminate/config Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0
illuminate/database Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0
jenssegers/mongodb Version ~3.3|~3.4