Log HTTP requests and responses in Laravel applications using PHP attributes
shoesten-tag/log-http is a Laravel package for log http requests and responses in laravel applications using php attributes.
It currently has 2 GitHub stars and 6 downloads on Packagist (latest version v0.1.1).
Install it with composer require shoesten-tag/log-http.
Discover more Laravel packages by shoesten-tag
or browse all Laravel packages to compare alternatives.
Last updated
Log HTTP requests and responses in Laravel applications using PHP attributes.
composer require shoesten-tag/log-http --dev
The default setting for both request and response logging is false. You can enable both by setting them to true or enable only one of them as needed.
Currently, logging is done only in the Laravel log file. However, if you change the logging channel, logs will be sent to the specified channel instead.
Not recommended for production use!
Add middleware to your routes
//Example
Route::resource('/dashboard', DashboardController::class)->middleware('log-http');
#[Intercept(response: true)]
public function index(){
return new Collection(Employee::all());
}
#[Intercept(request: true)]
public function index(){
return new Collection(Employee::all());
}
#[Intercept(request: true, response: true)]
class EmployeeController extends Controller
{
public function index(){
return new Collection(Employee::all());
}
}