PHPackages                             xcoorp/laravel-webpush-notifications - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. xcoorp/laravel-webpush-notifications

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

xcoorp/laravel-webpush-notifications
====================================

Web Push Notifications channel for Laravel.

v1.0.3(1mo ago)31.5k[1 issues](https://github.com/xcoorp/laravel-webpush-notifications/issues)[4 PRs](https://github.com/xcoorp/laravel-webpush-notifications/pulls)MITPHPPHP ^8.3CI passing

Since Dec 4Pushed 4d agoCompare

[ Source](https://github.com/xcoorp/laravel-webpush-notifications)[ Packagist](https://packagist.org/packages/xcoorp/laravel-webpush-notifications)[ Docs](https://github.com/xcoorp/laravel-webpush-notifications)[ RSS](/packages/xcoorp-laravel-webpush-notifications/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (22)Versions (17)Used By (0)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Laravel Version Requirements](https://camo.githubusercontent.com/73c83946578ddecab24143fda06e6c6ffeaa1ec9bb2e209776e011ff4e0ef460/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d7e31312e302d677261793f6c6f676f3d6c61726176656c267374796c653d666c61742d737175617265266c6162656c436f6c6f723d463035333430266c6f676f436f6c6f723d7768697465)](composer.json)

WebPush - Laravel Notification Channel
======================================

[](#webpush---laravel-notification-channel)

This package makes it easy to send notifications using [Web Push API](https://developer.mozilla.org/en-US/docs/Web/API/Push_API)

```
class InvoicePaidNotification extends Notification
{
    // Trigger a specific notification event
    public function toWebPush($notifiable)
    {
        return (new WebPushMessage)
                ->title('Approved!')
                ->body('Your account was approved!')
                ->action('View account', 'view_account')
                ->options(['TTL' => 1000]);
    }
}
```

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Publish Configuration and Migrations](#publishing-configuration-and-migrations)
    - [Configuration](#configuration)
- [Usage](#usage)
- [API Overview](#webpush-message)
    - [WebPush Message](#webpush-message)
- [Testing](#testing)
- [License](#license)

Installation
------------

[](#installation)

The Web Push notification channel can be installed easily via Composer:

```
composer require xcoorp/laravel-webpush-notifications
```

### Publishing Configuration and Migrations

[](#publishing-configuration-and-migrations)

After installing the package, you can publish the configuration file and migrations by running the following command:

```
php artisan vendor:publish --provider="NotificationChannels\WebPush\WebPushServiceProvider"
```

After publishing the migrations you should migrate your database:

```
php artisan migrate
```

After publishing the configuration file, you should configure the `vapid` keys in your `.env` file:

```
VAPID_PUBLIC_KEY=your-public-key
VAPID_PRIVATE_KEY=your-private-key
VAPID_SUBJECT=your-email or url
```

You can generate the vapid keys using the following command:

```
php artisan webpush-notifications:vapid
```

### Configuration

[](#configuration)

The `config/webpush-notifications.php` configuration file allows you to configure the default Web Push options for your application.

You can define custom Models to use, and the vapid keys to use for the Web Push API.

If you define a custom `UsereWebPushSubscription` model you need to make sure it extends the `UsereWebPushSubscription` model shipped with this package.

Usage
-----

[](#usage)

In order to send a notification via the WebPush channel, you'll need to specify the channel in the `via()` method of your notification:

```
use NotificationChannels\WebPush\WebPushChannel;

public function via($notifiable)
{
    return [
        WebPushChannel::class
    ]
}
```

API Overview
------------

[](#api-overview)

### WebPush Message

[](#webpush-message)

Namespace: `NotificationChannels\WebPush\WebPushMessage`

The `WebPushMessage` class encompasses an entire message that will be sent to the Web Push API.

- `title(string $title)` Set the `title` of the message
- `action(string $title, string $action, ?string $icon = null))` Set the `action` of the message
- `badge(string $badge)` Set the url to the `badge` image of the message
- `body(string $body)` Set the `body` of the message
- `dir(string $dir)` Set the text-direction `dir` of the message
- `icon(string $icon)` Set the url to the `icon` of the message
- `image(string $image)` Set the url to the `image` of the message
- `lang(string $lang)` Set the Language `lang` of the message
- `renotify(bool $renotify)` specifies whether the user should be notified after a new notification replaces an old one
- `requireInteraction(bool $requireInteraction)` specifies whether the notification requires interaction
- `tag(string $value)` Set the `tag` of the message
- `vibrate(array $vibrate)` Set the vibration pattern `vibrate` of the message
- `data(mixed $value)` Set the `data` of the message
- `options(array $options)` Set the `options` of the message (See [here](https://github.com/web-push-libs/web-push-php#notifications-and-default-options) for more information)
- `toArray()` Returns the data that will be sent to the WebPush API as an array

Code of Conduct
---------------

[](#code-of-conduct)

In order to ensure that the community is welcoming to all, please review and abide by the [Code of Conduct](CODE_OF_CONDUCT.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review the [security policy](SECURITY.md) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance88

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 55.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~174 days

Total

4

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6703727b3960b7f58325c28bc4b209acd71c4499d383759fc8397db50691a17?d=identicon)[toitzi](/maintainers/toitzi)

---

Top Contributors

[![cretueusebiu](https://avatars.githubusercontent.com/u/1517945?v=4)](https://github.com/cretueusebiu "cretueusebiu (103 commits)")[![joostdebruijn](https://avatars.githubusercontent.com/u/1844089?v=4)](https://github.com/joostdebruijn "joostdebruijn (19 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (14 commits)")[![xcoorp-renovate-bot[bot]](https://avatars.githubusercontent.com/in/1134662?v=4)](https://github.com/xcoorp-renovate-bot[bot] "xcoorp-renovate-bot[bot] (9 commits)")[![alberto-bottarini](https://avatars.githubusercontent.com/u/1442934?v=4)](https://github.com/alberto-bottarini "alberto-bottarini (5 commits)")[![toitzi](https://avatars.githubusercontent.com/u/42447585?v=4)](https://github.com/toitzi "toitzi (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![themustafaomar](https://avatars.githubusercontent.com/u/46113191?v=4)](https://github.com/themustafaomar "themustafaomar (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![vesper8](https://avatars.githubusercontent.com/u/816028?v=4)](https://github.com/vesper8 "vesper8 (2 commits)")[![web-flow](https://avatars.githubusercontent.com/u/19864447?v=4)](https://github.com/web-flow "web-flow (2 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (2 commits)")[![nmfzone](https://avatars.githubusercontent.com/u/10361906?v=4)](https://github.com/nmfzone "nmfzone (1 commits)")[![nonovd](https://avatars.githubusercontent.com/u/12936673?v=4)](https://github.com/nonovd "nonovd (1 commits)")[![oele-dev](https://avatars.githubusercontent.com/u/1950715?v=4)](https://github.com/oele-dev "oele-dev (1 commits)")[![oyed](https://avatars.githubusercontent.com/u/172114265?v=4)](https://github.com/oyed "oyed (1 commits)")[![patrickpietens](https://avatars.githubusercontent.com/u/132625?v=4)](https://github.com/patrickpietens "patrickpietens (1 commits)")[![Pes8](https://avatars.githubusercontent.com/u/2906048?v=4)](https://github.com/Pes8 "Pes8 (1 commits)")[![prakashchhetri](https://avatars.githubusercontent.com/u/3630412?v=4)](https://github.com/prakashchhetri "prakashchhetri (1 commits)")[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (1 commits)")

---

Tags

laravelnotificationswebpushlaravelnotificationsWebPush

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/xcoorp-laravel-webpush-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/xcoorp-laravel-webpush-notifications/health.svg)](https://phpackages.com/packages/xcoorp-laravel-webpush-notifications)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M195](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
