carolezountangni/log-supervisor

Database logging of user logs in a Laravel application

0.0.3 2024-05-06 16:48 UTC

This package is auto-updated.

Last update: 2025-05-03 14:00:18 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Database logging of user logs in a Laravel application

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.

bin/        
build/
docs/
config/
src/
tests/
vendor/

Install

Via Composer

 composer require carolezountangni/log-supervisor

Setup Migrations and Model

Dans votre fichier config/app.php, ajoutez le service provider dans le tableau providers :

'providers' => [
    // ...
    carolezountangni\LogSupervisor\LogSupervisorServiceProvider::class,
    
],

Dans votre fichier app/Http/Kernel.php, ajoutez le middleware comme ceci :

 protected $middleware = [
        // 
        \carolezountangni\LogSupervisor\Http\Middleware\Activity::class,
    ];

Publier les migrations et le fichier de configuration

php artisan vendor:publish --tag=migrations-ls
php artisan vendor:publish --tag=config-ls
php artisan migrate
php artisan vendor:publish --tag=public-ls

Affichage des logs au niveau d'une liste d'utilisateurs que vous avez créée par le biais d'un bouton.

Votre table d'utilisateur dit s'appeler "User" obligatoirement

<a href="{{ route('lg.logs.logs', $user->id) }}" class=" btn btn-warning m-1">Logs</a>

Gérer les middleware et le prefix des routes du package.

MY_PACKAGE_PREFIX=prefix-personnalise
MY_PACKAGE_MIDDLEWARES=middleware1,middleware2

Accès aux vues du package

Once the installation is complete, you will be able to access Log Supervisor directly in your browser.

By default, the application is available at: {APP_URL}/log-supervisor or {APP_URL}/MY_PACKAGE_PREFIX.

(for example: https://my-app.test/log-supervisor)

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

 composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email czountangni@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.