wremon / laralogs
This is my package laralogs
Fund package maintenance!
wremon
Installs: 6 280
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 7
Open Issues: 1
Requires
- php: ^7.4|^8.2
- illuminate/contracts: ^8.0|^9.0|^10.0
- spatie/laravel-package-tools: ^1.16
- ua-parser/uap-php: ^3.9
Requires (Dev)
- nunomaduro/collision: ^8.1
- orchestra/testbench: ^5.20
- pestphp/pest: ^2.30
- pestphp/pest-plugin-laravel: ^2.0
- spatie/laravel-ray: ^1.33
- vimeo/psalm: ^5.19
This package is auto-updated.
Last update: 2024-11-23 04:27:36 UTC
README
This package is for centralized logging of multiple Laravel application into one connection.
Installation
You can install the package via composer:
composer require wremon/laralogs
Configuration
After installing, publish the config using the command below:
php artisan vendor:publish --provider="Wremon\Laralogs\LaralogsServiceProvider"
Set Up .env
LARALOGS_DB_CONNECTION=sqlite
LARALOGS_DB_HOST=
LARALOGS_DB_PORT=
LARALOGS_DB_DATABASE=
LARALOGS_DB_USERNAME=
LARALOGS_DB_PASSWORD=
LARALOGS_DB_DATABASE="/Users/username/www/my-project/database/database.sqlite"
LARALOGS_APP_NAME="My App Name"
LARALOGS_USER_MODEL="\App\Models\User"
LARALOGS_USER_COLUMN="email"
The LARALOGS_APP_NAME
determines the name of the application in the logging table.
User Model
Include Laralogs to your User.php model.
use Wremon\Laralogs\Loggable;
use Loggable;
Usage
Get all the authentication logs of a user
User::find(1)->logs
Get the last authentication logs of a user
User::find(1)->lastLogin()
User::find(1)->lastLoginIp()
Get the previous authentication logs of a user
User::find(1)->previousLogin()
User::find(1)->previousLoginIp()
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.