New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

wremon/laralogs

This is my package laralogs
12,267 4
Install
composer require wremon/laralogs
Latest Version:v2.0.0
PHP:^7.4|^8.2
Laravel:8 · 9 · 10
Older releases:7
License:MIT
Last Updated:Jan 23, 2024
Links: GitHub  ·  Packagist
Maintainer: wremon

Laralogs

This package is for centralized logging of multiple Laravel application into one connection.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
v2.0.0 ^7.4|^8.2 ^8.0|^9.0|^10.0 MIT
v1.0.1 ^7.4|^8.0 ^7.0|^8.0 MIT
v1.0.0 ^7.4|^8.0 ^7.0|^8.0 MIT