Larafirebase is a package for sending push notifications and custom messages with Firebase in Laravel apps.
Larafirebase is a package by Gentrit Abazi that provides sending push notifications and custom messages with Firebase in Laravel applications. This package uses Firebase Cloud Messaging—a cross-platform messaging solution to send messages at no cost—to send notifications to users on the client-side.
Here is an example notification class that provides the toFirebase()
method to send notifications via the custom firebase
channel:
use Illuminate\Notifications\Notification;
use Kutia\Larafirebase\Messages\FirebaseMessage;
class SendBirthdayReminder extends Notification
{
/**
* Get the notification's delivery channels.
*/
public function via($notifiable)
{
return ['firebase'];
}
/**
* Get the firebase representation of the notification.
*/
public function toFirebase($notifiable)
{
$deviceTokens = [
'{TOKEN_1}',
'{TOKEN_2}'
];
return (new FirebaseMessage)
->withTitle('Hey, ', $notifiable->first_name)
->withBody('Happy Birthday!')
->asNotification($deviceTokens);
// OR ->asMessage($deviceTokens);
}
}
LIKE | COMMENT | SHARE | SUBSCRIBE The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in re...
LIKE | COMMENT | SHARE | SUBSCRIBE Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google...
LIKE | COMMENT | SHARE | SUBSCRIBE In this video, I will show you how to Create database into #firebase console. Subscribe & Stay Connected! Thank You! ♥ #Fi...
LIKE | COMMENT | SHARE | SUBSCRIBE In this video, I will show you how to save employee information into firebase database. Subscribe & Stay Connected! Thank ...
LIKE | COMMENT | SHARE | SUBSCRIBE The Firebase C# Library FireSharp contains development information for the Firebase API, written in C#. This library provi...