PHP code example of bilfeldt / laravel-request-logger

1. Go to this page and download the library: Download bilfeldt/laravel-request-logger 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/ */

    

bilfeldt / laravel-request-logger example snippets


Route::middleware('requestlog')->get('/', function () {
    return 'Hello World';
});

// Enable all requests:
'log_methods' => ['*'],

// or enable all server errors
'log_statuses' => ['5**'],

/**
 * Index posts.
 *
 * @param  Request  $request
 * @return Response
 */
public function index(Request $request)
{
    $request->enableLog();

    //
}

Route::middleware('log:example')->get('/', function () {
    return 'Hello World';
});

$request->enableLog('example');

$schedule->command('requestlog:prune')->daily();
bash
php artisan vendor:publish --provider="Bilfeldt\RequestLogger\RequestLoggerServiceProvider" --tag="request-logger-migrations"
php artisan migrate
bash
php artisan vendor:publish --provider="Bilfeldt\RequestLogger\RequestLoggerServiceProvider" --tag="request-logger-config"