<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
touhidurabir / laravel-request-response-logger example snippets
protected $routeMiddleware = [
...
'requests.responses.logger' => \Touhidurabir\RequestResponseLogger\Middlewares\LogRequestResponse::class,
];
// And then use it for one or more routes
Route::any('/some-route', SomeController::class)->middleware(['requests.responses.logger']);
protected function schedule(Schedule $schedule) {
...
$schedule->command('request-response-logger:clear')->weekly();
}
protected function schedule(Schedule $schedule) {
...
$schedule->command('request-response-logger:export')->dailyAt('00:01');
}
protected function schedule(Schedule $schedule) {
...
$schedule->command('request-response-logger:redis-import')->hourly();
}
use Touhidurabir\RequestResponseLogger\Models\RequestResponseLogger;
// Get every logged item with an http response code of 2xx:
RequestResponseLogger::successful()->get();
// Get every logged item with an http response code that ISN'T 2xx:
RequestResponseLogger::failed()->get();
// Get every logged item which are marked
RequestResponseLogger::marked()->get();