Download the PHP package adityadarma/laravel-database-logging without Composer
On this page you can find all versions of the php package adityadarma/laravel-database-logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adityadarma/laravel-database-logging
More information about adityadarma/laravel-database-logging
Files in adityadarma/laravel-database-logging
Package laravel-database-logging
Short Description Logging activities database for laravel
License MIT
Homepage https://github.com/adityadarma/laravel-database-logging
Informations about the package laravel-database-logging
Laravel Activity Logger
Laravel Database Logging is a feature that allows developers to store application logs in a database, rather than the default file-based storage. This feature provides a structured and organized approach to managing application logs, making it easier to query and analyze them.
Laravel Installation Instructions
-
From your projects root folder in terminal run:
-
Install config and asset to record the activities to:
-
Run the migration to add the table to record, before running please check morph key type on config to set type column:
*Note: Before migrate, please check config
/config/database-logging.php
type data on morp relation
Configuration
Laravel Database Logging can be configured in directly in /config/database-logging.php
if you published the assets.
Or you can variables to your .env
file.
Environment File
Here are the .env
file variables available:
Usage
Middleware Usage
Events for laravel authentication scaffolding are listened for as providers and are enabled via middleware. You can add events to your routes and controllers via the middleware:
Example to start recording page views using middleware in web.php
:
This middleware can be enabled/disabled in the configuration settings.
Trait Usage
Events can be recorded directly by using the trait. When using the trait you can customize the event description.
To use the trait:
-
Include the call in the head of your class file:
- Include the trait call in the opening of your class:
Routes
Laravel Activity Dashboard Routes
Set route access from file config database-logging.php
Purge
Remove data logger
Set limit days data log from file config database-logging.php
then run the command
License
This Package is licensed under the MIT license. Enjoy!