tomschlick/laravel-http2-server-push

A middleware package for Laravel 5 to enable server push for your script, style, and image assets.
67,824 163
Install
composer require tomschlick/laravel-http2-server-push
Latest Version:v0.2.1
PHP:>=7.0
License:MIT
Last Updated:Jun 25, 2021
Links: GitHub  ·  Packagist
Maintainer: tomschlick

Laravel / Lumen HTTP/2 Server Push Middleware

Build Status StyleCI Latest Stable Version Total Downloads Latest Unstable Version License

A middleware package for Laravel 5 / Lumen to enable server push for your script, style, and image assets.

Installation

First start by adding the package to your composer.json file

composer require tomschlick/laravel-http2-server-push

Next add the service provider to your config/app.php file:

\TomSchlick\ServerPush\ServiceProvider::class,

Then add the middleware to your Http Kernel (app/Http/Kernel.php). Do so towards the end of the list.

protected $middleware = [
    \TomSchlick\ServerPush\Http2ServerPushMiddleware::class,
];

Usage

Now when you enable it on a route it will automatically include the resources in your elixir /build/rev-manifest.json file. To add a resource manually you may use pushStyle($pathOfCssFile), pushScript($pathOfJsFile), pushFont($pathOfFontFile) or pushImage($pathOfImageFile) from anywhere in your project.

Related Packages

doctrine/dbal

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

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

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

413,412,504 609
nunomaduro/collision

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

394,964,158 4,660

Version History

Version Released PHP Laravel License
v0.2.1 >=7.0 ^5.1 MIT
v0.2.0 >=7.0 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.* MIT
v0.1.6 >=7.0 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* MIT
v0.1.5 >=7.0 5.1.*|5.2.*|5.3.*|5.4.* MIT
v0.1.4 >=7.0 5.1.*|5.2.*|5.3.*|5.4.* MIT