Package Data | |
---|---|
Maintainer Username: | enniel |
Maintainer Contact: | razumov.evgeni@gmail.com (Evgeni Razumov) |
Package Create Date: | 2016-12-20 |
Package Last Update: | 2020-04-24 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-18 03:04:42 |
Package Statistics | |
---|---|
Total Downloads: | 20,978 |
Monthly Downloads: | 3 |
Daily Downloads: | 0 |
Total Stars: | 22 |
Total Watchers: | 4 |
Total Forks: | 23 |
Total Open Issues: | 8 |
This package makes it easy to send notifications using Firebase Cloud Messaging (FCM) with Laravel 5.3. This package is based on brozot/laravel-fcm, so please read that documentation for more information.
You can install this package via composer:
composer require enniel/laravel-fcm-notification-channel:1.*
Register the provider directly in your app configuration file config/app.php
:
'providers' => [
// ...
NotificationChannels\FCM\ServiceProvider::class
]
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\FCM\FCMMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
public function via($notifiable)
{
return ['fcm'];
}
public function toFCM($notifiable)
{
return (new FCMMessage())
->notification([
'title' => 'Notification title',
'body' => 'Notification body',
]);
}
}
FCMMessage
: Send notifications to device(s).FCMMessageTopic
: Send notifications to topic(s).FCMMessageGroup
: Send notifications to group(s).In order for your notice to know who to send messages, you must add routeNotificationForFCM
method to your notification model.
data()
: Notification data. array
| LaravelFCM\Message\PayloadData
| LaravelFCM\Message\PayloadDataBuilder
options()
: Notification options. array
| LaravelFCM\Message\Options
| LaravelFCM\Message\OptionsBuilder
notification()
: Notification content. array
| LaravelFCM\Message\PayloadNotification
| LaravelFCM\Message\PayloadNotificationBuilder
setDryRun
setPriority
setTimeToLive
setCollapseKey
setDelayWhileIdle
setMutableContent
setContentAvailable
setRestrictedPackageName
isDryRun
getPriority
getTimeToLive
getCollapseKey
isDelayWhileIdle
isMutableContent
isContentAvailable
getRestrictedPackageName
setTag
setBody
setIcon
setTitle
setSound
setBadge
setColor
setChannelId
setClickAction
setBodyLocationKey
setBodyLocationArgs
setTitleLocationKey
setTitleLocationArgs
getTag
getBody
getIcon
getTitle
getSound
getBadge
getColor
getChannelId
getClickAction
getBodyLocationKey
getBodyLocationArgs
getTitleLocationKey
getTitleLocationArgs
$ composer test
Having trouble? Open an issue!
The MIT License (MIT). Please see License File for more information.