Download the PHP package juststeveking/eloquent-log-driver without Composer
On this page you can find all versions of the php package juststeveking/eloquent-log-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juststeveking/eloquent-log-driver
More information about juststeveking/eloquent-log-driver
Files in juststeveking/eloquent-log-driver
Package eloquent-log-driver
Short Description A Laravel Log Driver for Eloquent
License MIT
Homepage https://github.com/JustSteveKing/eloquent-log-driver
Informations about the package eloquent-log-driver
Eloquent Log Driver
A Laravel Log Driver for Eloquent
Installation
Via Composer
After installation, publish the migrations using:
Then we can run our migration, which will create a table called database_logs
.
Registering the driver with Laravel
In your .env
file add the following:
Then add the following to your config/logging.php
file under channels:
That is it! Your logs will now automatically start appearing in the database.
Querying Logs
There is a small selection of helper scope available on the DatabaseLog
model:
whereDebug()
whereInfo()
whereNotice()
whereWarning()
whereError()
whereCritical()
whereAlert()
whereEmergency()
whereLevel('log-level-case-insensitive')
All of the above will return an instance of an Eloquent Builder, allowing you to chain on further query parameters.
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Steve McDougall
- All Contributors
License
The MIT License (MIT). Please see License File for more information.