PHPackages                             dev1/notify-laravel - 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. dev1/notify-laravel

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

dev1/notify-laravel
===================

Laravel adapter for DEV1 Notify Core

1.1.0(7mo ago)08MITPHPPHP ^7.4|^8.0CI passing

Since Sep 22Pushed 7mo agoCompare

[ Source](https://github.com/DEV1-Softworks/notify-laravel)[ Packagist](https://packagist.org/packages/dev1/notify-laravel)[ RSS](/packages/dev1-notify-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (6)Used By (0)

DEV1 Notify Laravel Adapter
===========================

[](#dev1-notify-laravel-adapter)

[![Tests](https://github.com/DEV1-Softworks/notify-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/DEV1-Softworks/notify-laravel/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/655824942d358074af54b8e9b0852968a3b2f272e931c61d2be694d9ecb61466/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470733a2f2f676973742e67697468756275736572636f6e74656e742e636f6d2f525a45524f535445524e2f64656461393938613334306637366265316536396366376666303764616230632f7261772f6e6f746966792d636f7665726167652e6a736f6e)](#)[![Latest Stable Version](https://camo.githubusercontent.com/5c654dffc68ce63e053aba99c547ac946b57427257f226fb330af6c416ad4c1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646576312f6e6f746966792d6c61726176656c2e737667)](https://packagist.org/packages/dev1/notify-laravel)[![Total Downloads](https://camo.githubusercontent.com/4c11035c0456efdaa484daba1f700b08cc6e47841e639f0b9343fdecd15b731d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646576312f6e6f746966792d6c61726176656c2e737667)](https://packagist.org/packages/dev1/notify-laravel)

Adapter package to integrate [DEV1 Notify Core](https://packagist.org/packages/dev1/notify-core) into **Laravel 8+**.

Provides:

- Service Provider for Notify Core
- Config publishing (`config/notify.php`)
- Custom Laravel Notification Channel (`dev1-notify`)
- Logger bridge to Laravel.

---

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

[](#installation)

```
composer require dev1/notify-laravel
php artisan vendor:publish --tag=notify-config
```

Configuration
-------------

[](#configuration)

---

.env example:

```
NOTIFY_DEFAULT=fcm
NOTIFY_FCM_PROJECT_ID=your-firebase-project-id
NOTIFY_FCM_SA_PATH=app/firebase/service-account.json
NOTIFY_FCM_TIMEOUT=10 (optional, default 10)
NOTIFY_LOG=true (optional, default true)
```

For FCM v1, you need to create a Firebase project and generate a service account key JSON file at [Firebase Console](https://console.firebase.google.com/). After you download the JSON file, place it in a secure location within your Laravel project (e.g., `storage/app/firebase/service-account.json`).

Config file (`config/notify.php`) example:

```
return [
    'default' => env('NOTIFY_DEFAULT', 'fcm'),

    'clients' => [
        'fcm' => [
            'driver' => 'fcm_v1',
            'project_id' => env('NOTIFY_FCM_PROJECT_ID'),
            'service_account_json' => storage_path(env('NOTIFY_FCM_SA_PATH')),
            'scopes' => [
                'https://www.googleapis.com/auth/firebase.messaging',
            ],
            'timeout' => env('NOTIFY_FCM_TIMEOUT', 10),
            'platform_defaults' => [
                'android' => [
                    // 'priority' => 'HIGH',
                    // 'ttl' => 3600, // segundos (el transport lo convertirá a "3600s")
                    // 'notification' => ['icon' => 'ic_stat_notify'],
                ],
                'apns' => [
                    // 'headers' => ['apns-priority' => '10', 'apns-push-type' => 'alert'],
                    // 'aps'     => ['sound' => 'default', 'mutable-content' => 1],
                    // 'custom'  => [],
                ],
            ],
        ],
    ],

    'logging' => [
        'enabled' => env('NOTIFY_LOG', true),
        'channel' => env('NOTIFY_LOG_CHANNEL', null),
    ],
```

---

Usage
-----

[](#usage)

We have two ways to use Notify in Laravel, with a Facade or via the Notification Channel. Use the one that best fits your needs.

### Via Facade:

[](#via-facade)

This one is the simplest way to use Notify in Laravel, just call the `Notify` facade and send your notification. Recommended for a single notification.

```
use Notify;

use Dev1\NotifyCore\Platform\AndroidOptions;
use Dev1\NotifyCore\Platform\ApnsOptions;

$android = AndroidOptions::make()
    ->withChannelId('your_channel_id')
    ->withPriority('HIGH')
    ->withTtl(900);

$apns = ApnsOptions::make()
    ->withHeaders(['apns-priority' => '10', 'apns-push-type' => 'alert'])
    ->withAps(['sound' => 'default']);

$result = Notify::send(
    ['token' => 'AAA', 'topic' => null, 'condition' => null],
    [
        'title' => 'Hola',
        'body' => 'Mensaje de prueba',
        'data' => ['foo' => 'bar'],
        'android' => $android,
        'apns' => $apns,
    ],
    'fcm'
);

// $result is an instance of Dev1\NotifyCore\DTO\PushResult, use it for response handling.
```

### Via Notification Channel:

[](#via-notification-channel)

This one is intended to being used with Laravel Notifications, so you can use all the features of Laravel Notifications like queues, markdown, etc.

```
use Illuminate\Notifications\Notification;

class OrderPaid extends Notification
{
    public function via($notifiable) { return ['dev1-notify']; }

    public function toDev1Notify($notifiable): array
    {
        $token = $notifiable->fcm_token; // Assuming your User model has a fcm_token attribute

        // Platform specific options (optional)
        $android = AndroidOptions::make()
            ->withChannelId('your_channel_id')
            ->withPriority('HIGH')
            ->withNotification(['image' => 'https://cdn.example.com/paid.png']);

        $apns = ApnsOptions::make()
            ->withHeaders(['apns-priority' => '10', 'apns-push-type' => 'alert'])
            ->withAps(['sound' => 'default']);

        return [
            'client' => 'fcm',
            'target' => [
                'token' => , $token,
                'topic' => null,
                'condition' => null,
            ],
            'payload' => [
                'title' => 'Payment Received',
                'body' => "Your order has been paid. Enjoy!",
                'data' => ['order_id' => 123], // Optional custom data
                'android' => $android,
                'apns' => $apns,
            ],
        ];
    }
}
```

---

Events
------

[](#events)

Every push sent through `dev1-notify` channel dispatches:

`Dev1\NotifyLaravel\Events\NotifySent` event, which contains the following properties:

- `$notifiable`: The notifiable entity (e.g., User model).
- `$notification`: The notification instance.
- `$pushResult`: An instance of `Dev1\NotifyCore\DTO\PushResult`, containing details about the push result.

---

Testing
-------

[](#testing)

You can run the tests with:

```
./vendor/bin/phpunit
```

### CI &amp; CD

[](#ci--cd)

CI is provided with GitHub Actions, it runs on every push and pull request to the `master` branch. It runs the tests and generates code coverage reports.

- PHPUnit with Orchestra Testbench
- Enforces ≥ 80% coverage
- Coverage badge updated via Gist

Contributing
============

[](#contributing)

We welcome contributions! Please follow these steps:

1. Fork the repo and create a feature branch.
2. Run tests with `./vendor/bin/phpunit`.
3. Ensure coverage ≥ 80%.
4. Submit a PR.

Issues and suggestions are welcome on GitHub.

Made with ❤️ in Mexico 🇲🇽 by [DEV1 Softworks Labs](https://labs.dev1.mx)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance62

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

237d ago

### Community

Maintainers

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

---

Top Contributors

[![RZEROSTERN](https://avatars.githubusercontent.com/u/3065243?v=4)](https://github.com/RZEROSTERN "RZEROSTERN (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dev1-notify-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/dev1-notify-laravel/health.svg)](https://phpackages.com/packages/dev1-notify-laravel)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/webpush

Web Push Notifications driver for Laravel.

7984.5M16](/packages/laravel-notification-channels-webpush)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)

PHPackages © 2026

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