New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

samfelgar/log-requests

5,051
Install
composer require samfelgar/log-requests
Latest Version:3.0.0
PHP:^7.4 || ^8.0
Laravel:5 – 10
License:MIT
Last Updated:Sep 16, 2026
Links: GitHub  ·  Packagist
Maintainer: samfelgar

Log requests

This package provides a simple request logger to be used with Laravel applications.

Installation

You can install this package via composer:

composer require samfelgar/log-requests

By default, the logging channel used is the stack, but you can change this by publishing the config file:

php artisan vendor:publish --provider=Samfelgar\\LogRequests\\Providers\\LogRequestServiceProvider

After running the command above, the file log-requests.php will be created in the config path.

Usage

This package registers a middleware alias that can be used in your routes files:

use Illuminate\Support\Facades\Route;

Route::middleware(['log-requests'])->group(function () {
    // Your logged routes goes here.
});

You may also register the middleware within a group or globally by editing the \App\Http\Kernel class:

  • In groups
protected $middlewareGroups = [
    'web' => [
        // Other middleware
        \Samfelgar\LogRequests\Http\Middleware\LogRequest::class,
    ],

    'api' => [
        'throttle:api',
        'bindings',
        \Samfelgar\LogRequests\Http\Middleware\LogRequest::class,
    ],
];
  • Globally
protected $middleware = [
    // Other middleware
    \Samfelgar\LogRequests\Http\Middleware\LogRequest::class,
];

For more information about middlewares in Laravel, check the documentation.

Contributing

Found an error? Open an issue!

Any contribution is appreciated, just submit a pull request.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
3.0.0 ^7.4 || ^8.0 ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 MIT
v2.1 ^7.4 || ^8.0 ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 MIT
v2.0 ^7.4 || ^8.0 ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 MIT
v1.0 ^7.4|^8.0 ^5.0|^6.0|^7.0|^8.0 MIT