revolution/laravel-server-push

此包已被 弃用 且不再维护。未建议替代包。

Laravel 服务器推送中间件

1.3.0 2022-03-12 06:11 UTC

This package is auto-updated.

Last update: 2022-08-22 02:07:05 UTC


README

tests Maintainability Test Coverage

https://github.com/tomschlick/laravel-http2-server-push 重新制作

变更

  • 仅支持 Laravel mix
  • 删除全局助手函数
  • 仅推送 get 请求和 text/html 响应
  • config/server-push.php 兼容

要求

  • PHP >= 7.4
  • Laravel >= 6.0

安装

composer require revolution/laravel-server-push

发布配置文件(可选)

php artisan vendor:publish --tag=server-push-config

添加到 Web 中间件组

protected $middlewareGroups = [
        'web' => [
            //...
            \Revolution\ServerPush\ServerPush::class,
        ],

代替全局助手函数

use Revolution\ServerPush\LinkBuilder;

app(LinkBuilder::class)->addLink('/image/test.jpg')->addLink('/css/test.css');

许可协议

MIT
版权所有 kawax