PHP code example of revolution / laravel-server-push
1. Go to this page and download the library: Download revolution/laravel-server-push library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
revolution / laravel-server-push example snippets
protected $middlewareGroups = [
'web' => [
//...
\Revolution\ServerPush\ServerPush::class,
],
use Revolution\ServerPush\LinkBuilder;
app(LinkBuilder::class)->addLink('/image/test.jpg')->addLink('/css/test.css');
php artisan vendor:publish --tag=server-push-config