Remake from https://github.com/tomschlick/laravel-http2-server-push
- Support only Laravel mix
- Delete global helpers
- Push only
get
request andtext/html
response - Compatible with
config/server-push.php
- PHP >= 7.4
- Laravel >= 6.0
composer require revolution/laravel-server-push
php artisan vendor:publish --tag=server-push-config
protected $middlewareGroups = [
'web' => [
//...
\Revolution\ServerPush\ServerPush::class,
],
use Revolution\ServerPush\LinkBuilder;
app(LinkBuilder::class)->addLink('/image/test.jpg')->addLink('/css/test.css');
MIT
Copyright kawax