alitindrawan24/laravel-request-id 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alitindrawan24/laravel-request-id

最新稳定版本:1.0.2.0

Composer 安装命令:

composer require alitindrawan24/laravel-request-id

包简介

README 文档

README

Latest Version on Packagist Total Downloads License: MIT

Request ID is uniquely identifies the HTTP request sent from the app to the service and enables the app to correlate requests and responses, in case the app needs to resend a request because of a dropped connection. This package provides a middleware that allows to generate a unique request id and append on log context every time if the log called.

Installation

You can install the package via composer:

composer require alitindrawan24/laravel-request-id

You can publish the config file with:

php artisan vendor:publish --provider="Alitindrawan24\RequestID\RequestIDServiceProvider" --tag="config" 

Usage

This packages provides a middleware which can be added as a global middleware or as a single route.

// in `app/Http/Kernel.php`

protected $middleware = [
    // ...
    
    \Alitindrawan24\RequestID\Middleware\RequestIDMiddleware::class
];
// in a routes file

Route::post('/dashboard', function () {
    //
})->middleware(\Alitindrawan24\RequestID\Middleware\RequestIDMiddleware::class);

Testing

composer test

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contributors

统计信息

  • 总下载量: 169
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-18