定制 torgodly/filament-fcm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

torgodly/filament-fcm

最新稳定版本:v1.0.1

Composer 安装命令:

composer require torgodly/filament-fcm

包简介

Firebase Cloud Messaging integration to Native FilamentPHP Notification Package

README 文档

README

Screenshot

Filament Firebase Integration

Latest Stable Version License Downloads

Firebase Cloud Messaging integration to Native FilamentPHP Notification Package

Installation

composer require torgodly/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(\Torgodly\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 Torgodly

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固