newms87/danx

Danx Auditing, Logging, and Helpers

1.2.10 2024-06-14 22:36 UTC

This package is auto-updated.

Last update: 2024-06-14 22:37:08 UTC


README

Danx Package

Installation

composer require danx/laravel

Setup

Publish the configuration file

sail artisan vendor:publish --provider="Newms87\Danx\DanxServiceProvider"

Development

Install Danx UI

Setup Danx UI

Configure CORS

sail artisan config:publish cors
  • Configure the paths so the desired routes are allowed
    • NOTE: By default it is open to all requests

Symlink the Danx library

Symlinking the library will allow for realtime development of the danx library package. This is only useful for development. The command will symlink the vendor/newms87/danx package to the danx git repo that should be located in the same directory as the project.

ie:

- parent
  - danx
  - your-project
    - vendor
      - newms87
        - danx --> ../../../danx

If using docker, the danx library should be mounted to the docker container.

services:
  laravel.test:
    volumes:
      - '../danx:/var/www/danx'

Run the command

sail artisan danx:link

Publish package to composer

To publish packages, simply push a new tagged version to the repository.

make VERSION=1.0.0 publish

Setup

Audit Logging

  • Update config/logging.php
'channels' => [
    
    //...
    
    'auditlog' => [
            'driver' => 'custom',
            'via'    => Newms87\Danx\Logging\Audit\AuditLogLogger::class,
            'level'  => env('LOG_LEVEL', 'debug'),
        ],
],
  • Update .env
    • recommended to use stack as the main channel, so you can add additional logging channels
LOG_CHANNEL=stack
LOG_STACK={single},{other-log-channels},auditlog