| Package Data | |
|---|---|
| Maintainer Username: | tomschlick |
| Maintainer Contact: | tom@schlick.email (Tom Schlick) |
| Package Create Date: | 2016-07-28 |
| Package Last Update: | 2021-06-25 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-28 03:00:29 |
| Package Statistics | |
|---|---|
| Total Downloads: | 66,381 |
| Monthly Downloads: | 269 |
| Daily Downloads: | 22 |
| Total Stars: | 166 |
| Total Watchers: | 4 |
| Total Forks: | 19 |
| Total Open Issues: | 5 |
A middleware package for Laravel 5 / Lumen to enable server push for your script, style, and image assets.
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,
];
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.