Laravel Notification Channels

Laravel Notification Channels

Laravel Notification Channels is a collection of custom notification drivers for Laravel. With roughly thirty-nine ready-to-use channels at the time of writing, this is likely the most extensive collection of notification plugins for any framework.

The notification channels GitHub organization is a centralized place for all of the different notification packages. However, individual packages might be maintained by various authors:

We aim to provide a curated selection of notification channels for use in your Laravel applications…If we don’t have a package for your desired service yet, read on for instructions on how to contribute!

If you have an idea for a notification channel, check out the skeleton repo for creating a new notification channel. Once you are ready to contribute your channel, open a pull request to laravel-notification-channels/channels. Authors get admin access to their channel repository and an invite to the Laravel Notification Channels GitHub organization.

Here’s a quick example of an account notification from the Apple Push Notification service (APNs) documentation:

use NotificationChannels\Apn\ApnChannel;
use NotificationChannels\Apn\ApnMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [ApnChannel::class]; // Make sure you use ‘ApnChannel::class’, not just ‘apn’
    }

    public function toApn($notifiable)
    {
        return ApnMessage::create()
            ->badge(1)
            ->title(‘Account approved’)
            ->body(“Your {$notifiable->service} account was approved!”);
    }
}

To learn more about the available channels, check out the official documentation. Each channel in the documentation has installation instructions and details on getting started.


Filed in: News


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

PHP Data Engineer
Remote (US)
FBS
Software Developer
Remote (US & Canada)
Alley
Backend Software Engineer
Remote (UTC +/- 5)
Smartbnb
Programmer
Remote (Overlap w/ Continental US Time Zones)
Tighten
Senior Backend Engineer
Remote
64 Robots
Senior Laravel Developer
Atlanta, GA
Helium LLC
Full-Stack Developer (JS - Vue.js, PHP - Laravel)
US Remote / Telecommute
TTEC Digital