New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

wijourdil/ntfy-notification-channel

ntfy.sh Notification Channel for Laravel
13,547 23
Install
composer require wijourdil/ntfy-notification-channel
Latest Version:5.1.0
PHP:^8.3
Laravel:13
Older releases:9 – 12
License:MIT
Last Updated:Jun 22, 2026
Links: GitHub  ·  Packagist
Maintainer: wijourdil

ntfy.sh Notification Channel for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package adds a Laravel Notification Channel to sent messages via ntfy. It's build on top of the verifiedjoseph/ntfy-php-library package.

Installation

Install the package via composer:

composer require wijourdil/ntfy-notification-channel

Publish the config file with:

php artisan vendor:publish --tag="ntfy-notification-channel-config"

Configuration

If you are using the online version https://ntfy.sh, you don't need to configure the server base url. But if you are using a self-hosted version of ntfy, you can configure it in your .env file:

NTFY_SERVER=https://ntfy.example.com

By default, authentication is disabled. If you want to connect using credentials, you can also configure it within you .env file:

# Activate authentication by setting this variable to `true`
NTFY_AUTH_ENABLED=true

# You can either authenticate with username & password...
NTFY_AUTH_USERNAME=michel
NTFY_AUTH_PASSWORD=m0tDeP4ss3

# ... or with a token instead of username and password
NTFY_AUTH_TOKEN="tk_mo0babk5gtg2suidltq5d8r7o2a67"

To see default values and other settings, see the config/ntfy-notification-channel.php config file.

Usage

In your Notification class, tell Laravel to send your notification via ntfy by returning the NtfyChannel::class in the via() method:

use Wijourdil\NtfyNotificationChannel\Channels\NtfyChannel;

public function via($notifiable)
{
    return [NtfyChannel::class];
}

Then, define a toNtfy() method in your Notification:

use Ntfy\Message;

public function toNtfy(mixed $notifiable): Message
{
    $message = new Message();
    $message->topic('test');
    $message->title('It works!');
    $message->body("And voila, I sent my notification using ntfy.sh!");
    $message->tags(['white_check_mark', 'ok_hand']);

    return $message;
}

Here is what the notification looks like using the ntfy mobile app:

Notification example with ntfy app

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

Related Packages

tricki/laravel-notification

A basic user notification package for Laravel 4

315 27
mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1,213,685 1,728
babenkoivan/telegram-notifications

Telegram notifications for Laravel

52,757 38
williamcruzme/laravel-fcm

A powerful Laravel package to send Push Notifications

14,859 64
avto-dev/smspilot-notifications-laravel

Notifications channel for SMS Pilot service

7,036 3

Version History

Version Released PHP Laravel License
5.1.0 ^8.3 ^13.0 MIT
5.0.0 ^8.3 ^13.0 MIT
4.1.0 ^8.2 ^12.0 MIT
4.0.0 ^8.2 ^12.0 MIT
3.0.0 ^8.2 ^11.0 MIT