fahmiardi/laravel-notification is a Laravel package for various laravel notifications channels.
It currently has 0 GitHub stars and 228 downloads on Packagist (latest version 0.1).
Install it with composer require fahmiardi/laravel-notification.
Discover more Laravel packages by fahmiardi
or browse all Laravel packages to compare alternatives.
Last updated
credentials or profile$ composer require fahmiardi/laravel-notification
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
],
];
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));