PHP code example of adityadarma / laravel-database-logging

1. Go to this page and download the library: Download adityadarma/laravel-database-logging 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/ */

    

adityadarma / laravel-database-logging example snippets


// config/database.php
'connections' => [
    'logging' => [
        'driver' => 'mysql',
        'host' => env('DB_LOGGING_HOST', '127.0.0.1'),
        'database' => env('DB_LOGGING_DATABASE', 'logging'),
        'username' => env('DB_LOGGING_USERNAME', 'forge'),
        'password' => env('DB_LOGGING_PASSWORD', ''),
        // ...
    ],
],

'model' => [
    App\Models\User::class => 'name',
],

Route::group(['middleware' => ['web', 'capture-logging']], function () {
    Route::get('/', 'WelcomeController@welcome')->name('welcome');
});

    use \AdityaDarma\LaravelDatabaseLogging\Traits\DatabaseLoggable;
    

    use DatabaseLoggable;
    
bash
    php artisan database-logging:install
    
bash
    php artisan migrate