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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-database-logging

Laravel Database Logging

Tests Latest Stable Version License

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

  1. From your projects root folder in terminal run:

  2. Install config and asset to record the activities to:

  3. 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:

Separate logging database

Point DB_CONNECTION_LOGGING at any connection defined in config/database.php. The database_loggings table is created on that connection, and the log rows keep their own copy of the actor name in user_name, so the dashboard renders correctly even though the logging database holds no users table.

Which column holds the display name is set per model in database-logging.php:

Note on the loggable relation: Eloquent forces a morphTo related model onto the parent's connection when that model declares no connection of its own (MorphTo::createModelByType). With a separate logging database $log->loggable would therefore look for your users table inside the logging database. Use $log->resolveLoggable(), which queries the related model on its own connection, or read $log->name which already does it for you.

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:

  1. Include the call in the head of your class file:

  2. 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!


All versions of laravel-database-logging with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package adityadarma/laravel-database-logging contains the following files

Loading the files please wait ...