1. Go to this page and download the library: Download yoeriboven/laravel-log-db library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yoeriboven / laravel-log-db example snippets
use Illuminate\Support\Facades\Log;
Log::channel('db')->info('Your message');
use Yoeriboven\LaravelLogDb\DatabaseLogger;
return [
'channels' => [
'db' => [
'driver' => 'custom',
'via' => DatabaseLogger::class,
'connection' => env('LOG_DB_CONNECTION'), // Optional, defaults to app's DB connection
'days' => 7, // Optional, retention period in days
],
]
]