Download the PHP package benwilkins/laravel-fcm-notification without Composer
On this page you can find all versions of the php package benwilkins/laravel-fcm-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benwilkins/laravel-fcm-notification
More information about benwilkins/laravel-fcm-notification
Files in benwilkins/laravel-fcm-notification
Package laravel-fcm-notification
Short Description Laravel FCM (Firebase Cloud Messaging) Notification Channel
License MIT
Informations about the package laravel-fcm-notification
Laravel FCM Notification
Laravel FCM (Firebase Cloud Messaging) Notification Channel
Use this package to send push notifications via Laravel to Firebase Cloud Messaging. Laravel 5.5+ required.
This package works only with Legacy HTTP Server Protocol
Install
This package can be installed through Composer.
If installing on < Laravel 5.5 then add the service provider:
Add your Firebase API Key in config/services.php
.
Example Usage
Use Artisan to create a notification:
Return [fcm]
in the public function via($notifiable)
method of your notification:
Add the method public function toFcm($notifiable)
to your notification, and return an instance of FcmMessage
:
When sending to specific device, make sure your notifiable entity has routeNotificationForFcm
method defined:
When sending to a topic, you may define so within the toFcm
method in the notification:
Or when sending with a condition:
You may provide optional headers or override the request headers using setHeaders()
:
Interpreting a Response
To process any laravel notification channel response check Laravel Notification Events
This channel return a json array response:
Check FCM Legacy HTTP Server Protocol for response interpreting documentation.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-fcm-notification with dependencies
guzzlehttp/guzzle Version ^6.2|^7.0
illuminate/notifications Version ~5.3|^6.0|^7.0|^8.0
illuminate/queue Version ~5.3|^6.0|^7.0|^8.0
illuminate/support Version ~5.3|^6.0|^7.0|^8.0
illuminate/config Version ~5.3|^6.0|^7.0|^8.0