Skip to content
Laravel Server Push Middleware
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.styleci.yml
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

Laravel Server Push Middleware

Build Status Maintainability Test Coverage

Remake from https://github.com/tomschlick/laravel-http2-server-push

CHANGES

  • Support only Laravel mix
  • Delete global helpers
  • Push only get request and text/html response
  • Compatible with config/server-push.php

Requirements

  • PHP >= 7.1
  • Laravel >= 5.5

Installation

composer require revolution/laravel-server-push

Publish config file (Optional)

php artisan vendor:publish --provider="Revolution\ServerPush\Providers\ServerPushServiceProvider"

Add to web middleware group

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

Instead of global helpers

use Revolution\ServerPush\LinkBuilder;

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

LICENSE

MIT
Copyright kawax

You can’t perform that action at this time.