定制 creativeorange/laravel-served-by 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

creativeorange/laravel-served-by

最新稳定版本:v12.0.0

Composer 安装命令:

composer require creativeorange/laravel-served-by

包简介

Automatically set the Served By for requests in your Laravel Framework.

README 文档

README

Latest Version on Packagist Total Downloads

Useful middleware for Laravel Requests & Jobs to determine which server is serving (or running) the request. For HTTP requests, the identifier string will be sent back as HTTP Header "X-Served-By". In jobs, it is possible to send Context to Flare, or tag the server in Horizon.

Installation

You can install the package via composer:

composer require creativeorange/laravel-served-by

For Laravel 8 or lower please install version 1.

Requirements

  • PHP 8.2+
  • Laravel 9, 10, 11, or 12

Usage HTTP requests

To allow Served By for all your routes, add the ServedBy middleware at the top of the $middleware property of app/Http/Kernel.php class:

protected $middleware = [
    \Creativeorange\ServedBy\Http\Middleware\ServedBy::class,
    // ...
];

Flare

If you use Flare, you can add the following to your job(s):

    /**
     * Get the middleware the job should pass through.
     *
     * @return array
     */
    public function middleware()
    {
        return [new Creativeorange\ServedBy\Http\Middleware\Jobs\ServedBy];
    }

Configuration

The defaults are set in config/served-by.php. Publish the config to copy the file to your own config:

php artisan vendor:publish --tag="served-by"

By default, you can also overwrite the identifier string by adding SERVED_BY_IDENTIFIER to your .env

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固