Stream Notifications Channel for Laravel 5.3

v1.0.0 2017-02-08 09:47 UTC

This package is not auto-updated.

Last update: 2023-05-27 12:53:27 UTC


Dependency Status Build Status Coverage Status StyleCI Status

Use Laravel 5.3 notifications to send activities to Stream.



Install this package with Composer:

composer require techinasia/laravel-stream-notification-channel-notification-channel

Register the service provider in your config/app.php:


Setting up Stream

This notification channel uses techinasia/laravel-stream to send notifications to Stream.

Publish all the vendor assets:

php artisan vendor:publish

This will create a file called stream.php in the config folder. Create an application via Stream's admin interface and copy the API key and secret to the configuration file.

You can add more applications by adding more key/secret pairs to the configuration file:

'applications' => [
    'main' => [
        'key' => 'key1',
        'secret' => 'secret1',
    'foo' => [
        'key' => 'foo',
        'secret' => 'bar',


Send notifications via Stream in your notification:

use NotificationChannels\GetStream\StreamChannel;
use NotificationChannels\GetStream\StreamMessage;
use Illuminate\Notifications\Notification;

class TestNotification extends Notification
    public function via($notifiable)
        return [StreamChannel::class];

    public function toStream($notifiable)
        return (new StreamMessage())

You need to specify the ID and type of the notifiable by defining a routeNotificationForStream method on the entity:

 * Notification routing information for Stream.
 * @return array
public function routeNotificationForStream()
    return [
        'type' => 'user',
        'id' => $this->id,

Available Message methods

  • application(string $application): Sets the application to be used to send the notification.

You can set any attributes of the payload by calling the name of the attribute in camel case with the value as the parameter:

return (new StreamMessage())


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


composer test


If you discover any security related issues, please email instead of using the issues tracker.


Please see CONTRIBUTING for details.



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