Download the PHP package tonini46/laravel-fcm-notification without Composer
On this page you can find all versions of the php package tonini46/laravel-fcm-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tonini46/laravel-fcm-notification
More information about tonini46/laravel-fcm-notification
Files in tonini46/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
laravel/framework Version ^5.7|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
guzzlehttp/guzzle Version *
illuminate/notifications Version *
illuminate/queue Version *
illuminate/support Version *
illuminate/config Version *