You can install the package via composer:
composer require cavespoidy/laralogger
git clone https://github.com/prithwijoysaha/LaraLogger LaraLogger
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use cavespoidy\LaraLogger\LaraLogger;
class User extends Authenticatable
{
use LaraLogger;
}
By default its uses the Auth()->id for userId to customize it just publish it. After publishing you will find a file named laralogger.php at config directory.
- LaraLogger only works with DML queries of Laravel Eloquent Example:
User::find(1)->delete(); // For this LaraLogger is made for.
User::where('id',1)->delete(); // For this LaraLogger don't work.
- LaraLogger will average execution time is 10ms approx.
- LaraLogger wont save the geo-location details and isp-details for localhost/127.0.0.1
- It can throw exceptions only in local environment. And save exceptions at log file for production environment for smoother experience.
- LaraLogger by default use two open source APIs: => www.geoplugin.net => www.ip-api.com Thanks to geoplugin.net and ip-api.com
composer require cavespoidy/laralogger/Test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.