fahmiardi/laravel-notification

Various laravel notifications channels
228
Install
composer require fahmiardi/laravel-notification
Latest Version:0.1
Laravel:5
License:MIT
Last Updated:Dec 15, 2016
Links: GitHub  ·  Packagist
Maintainer: fahmiardi

More Laravel Notification Providers

Available Channels:

  • AWS SNS (Simple Notification Services), support using credentials or profile

Install

$ composer require fahmiardi/laravel-notification

Setup

Add config to app/services.php:

return [
    ...
    'sns' => [
        'key' => env('SNS_KEY'),
        'secret' => env('SNS_SECRET'),
        'region' => env('SNS_REGION'),
        'profile' => env('AWS_PROFILE'), // keep this value empty when using credentials
    ],
];

Usage

Use generic:

<?php

$user->notify(
    new \Fahmiardi\Laravel\Notifications\GenericSnsNotification($topicArn, $subject, $message)
);

Create your own:

Read the official page https://laravel.com/docs/5.3/notifications#creating-notifications

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Fahmiardi\Laravel\Notifications\Channels\SnsChannel;
use Fahmiardi\Laravel\Notifications\Messages\SnsMessage;

class InvoicePaid extends Notification
{
    protected $invoice;

    public function __construct($invoice)
    {
        $this->invoice = $invoice;
    }

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

    public function toSns($notifiable)
    {
        return (new SnsMessage)
            ->topicArn('ARN')
            ->subject('SUBJECT')
            ->message('MESSAGE');
    }
}

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

Related Packages

lab123/aws-sns

Amazon SNS notification channels (SMS and topics) for Laravel

28,811 31
tricki/laravel-notification

A basic user notification package for Laravel 4

315 27
mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1,205,788 1,729
babenkoivan/telegram-notifications

Telegram notifications for Laravel

52,202 38
williamcruzme/laravel-fcm

A powerful Laravel package to send Push Notifications

14,859 64

Version History

Version Released Laravel License
0.1 ~5.0 MIT