Firebase Integration
Firebase Cloud Messaging integration to Native FilamentPHP Notification Package
Author:
Fady Mondy
Documentation

Firebase Cloud Messaging integration to Native FilamentPHP Notification Package
#Installation
composer require tomatophp/filament-fcm
after install your package you need to update this keys in your .env file
# Firebase Project
FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_DATABASE_URL=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=
FIREBASE_MEASUREMENT_ID=
# Firebase Admin SDK
FIREBASE_CREDENTIALS=
# Firebase Cloud Messaging
FIREBASE_VAPID=
# Firebase Alert Sound
FCM_ALERT_SOUND=
after update clear config
php artisan config:clear
then please run this command
php artisan filament-fcm:install
if you are not using this package as a plugin please register the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\TomatoPHP\FilamentFcm\FilamentFcmPlugin::make()
)
#Usage
you can use the filament native notification and we add some macro for you
use Filament\Notifications\Notification;
Notification::make('send')
->title('Test Notifications')
->body('This is a test notification')
->icon('heroicon-o-bell')
->color('success')
->actions([
\Filament\Notifications\Actions\Action::make('view')
->label('View')
->url('https://google.com')
->markAsRead()
])
->sendToFCM(
user: auth()->user(),
data: [
'key' => 'value'
],
sendToDatabase: false,
type: 'fcm-web' // or fcm-api
)
or you can send it directly from the user model
$user->notifyFCMSDK(
message: $this->message,
type: $this->provider,
title: $this->title,
url: $this->url,
image: $this->image,
icon: $this->icon,
data: [
'url' => $this->url,
'id' => $this->model_id,
'actions' => [],
'body' => $this->message,
'color' => null,
'duration' => null,
'icon' => $this->icon,
'iconColor' => null,
'status' => null,
'title' => $this->title,
'view' => null,
'viewData' => null,
'data'=> $this->data
],
sendToDatabase: false
);
#Publish Assets
you can publish config file by use this command
php artisan vendor:publish --tag="filament-fcm-config"
you can publish views file by use this command
php artisan vendor:publish --tag="filament-fcm-views"
you can publish migrations file by use this command
php artisan vendor:publish --tag="filament-fcm-migrations"
#Other Filament Packages
Checkout our Awesome TomatoPHP
The author
Firebase Cloud Messaging integration to Native FilamentPHP Notification Package
From the same author
Tenancy Multi-database
Tenancy multi-database integration for FilamentPHP
Author:
Fady Mondy
Menu Generator
Menu view generator using view component
Author:
Fady Mondy
Translations Manager
Manage your translation with DB and cache, you can scan an collect translation strings like `trans()` and `__()`, and translate them using UI
Author:
Fady Mondy
Meta Manager
Convert any model on your app to pluggable model using Meta and get ready to use relation manager on FilamentPHP panel
Author:
Fady Mondy
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese
Data Lens
Advanced Data Visualization for Laravel Filament - a premium reporting solution enabling custom column creation, sophisticated filtering, and enterprise-grade data insights within admin panels.
Padmission