Reactive Laravel Notification

v1.0 2018-12-30 13:10 UTC

This package is auto-updated.

Last update: 2021-12-29 02:41:41 UTC



PHP >=5.6 and Laravel ^5.3 are required.

To get the latest version of Reactive Laravel notification, simply require the project using Composer:

composer require digitalcloud/reactive-notification

publishing migration file

php artisan vendor:publish --provider="Digitalcloud\ReactiveNotification\ReactiveNotificationServiceProvider"

migrate published migration files

php artisan migrate


  1. Change trait used in model from Illuminate\Notifications\Notifiable to Digitalcloud\ReactiveNotification\Traits\Notifiable

namespace App;

use Digitalcloud\ReactiveNotification\Traits\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
    use Notifiable;
  1. Change delivery channel from database or DatabaseChannel to Digitalcloud\ReactiveNotification\Channels\DatabaseChannel

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Digitalcloud\ReactiveNotification\Channels\DatabaseChannel;

class InvoicePaid extends Notification implements ShouldQueue
    use Queueable;

    public function via($notifiable)
        return [DatabaseChannel::class,'.../'];
    public function toDatabase($notifiable){
        return [
          "title"=> trans("invoice_title"),
          "details"=> trans("invoice_details"),


$user->notify(new InvoicePaid($invoice));

$result = $user->notifications()->first()->data;

the result will be [ "title" => "Invoice title", "details" => "Invoice details" ]

then change the old language from en into ar

$result = $user->notifications()->first()->data;

and the result will be [ "title" => "عنوان الفاتورة", "details" => "تفاصيل الفاتورة" ]