---
title: "Installation & Setup"
package: "Laravel Server Push Manager"
version: "1.x"
canonical_url: "https://www.babdev.com/open-source/packages/laravel-server-push-manager/docs/1.x/installation"
package_supported: false
version_released: true
end_of_support: "2021-03-14T23:59:59.999Z"
notice:
  - "The Laravel Server Push Manager package is no longer supported and will not receive further updates or bug fixes. You are advised to migrate to an alternative solution."
  - "Version 1.x of Laravel Server Push Manager reached end of support on 2021-03-14."
---
# Installation & Setup

To install this package, run the following [Composer](https://getcomposer.org/) command:

```bash
composer require babdev/laravel-server-push-manager
```

## Register The Package

If your application is not using package discovery, you will need to add the service provider to your `config/app.php` file.

```php
return [
    'providers' => [
        BabDev\ServerPushManager\Providers\ServerPushManagerProvider::class,
    ],
];
```

To use the facade, you will also need to register it in your `config/app.php` file.

```php
return [
    'aliases' => [
        'PushManager' => BabDev\ServerPushManager\Facades\PushManager::class,
    ],
];
```

## Add Middleware

To automatically send the correct header from the resources added to the manager, you will need to register `BabDev\ServerPushManager\Http\Middleware\ServerPush` as a middleware in your kernel. It is recommended to add it to only groups which handle web traffic with pushed assets, such as the default "web" group:

```php
<?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    protected $middlewareGroups = [
        'web' => [
            // ..
            \BabDev\ServerPushManager\Http\Middleware\ServerPush::class,
        ],
    ];
}
```
