besanek/laravel-firebase-notifications 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

besanek/laravel-firebase-notifications

最新稳定版本:v4.2.1

Composer 安装命令:

composer require besanek/laravel-firebase-notifications

包简介

Thin layer for integrate Firebase Messaging as Laravel Notifications

README 文档

README

Thin layer for integrate Firebase Messaging as Laravel Notifications

Requirement

  • PHP >= 8.1
  • Laravel = 10.x

Installing

$ composer require "besanek/laravel-firebase-notifications"

This is all, thanks to the Package Autodiscover.

Setup

Please follow configuration guide of kreait/laravel-firebase

Basic Usage

Add new method routeNotificationForFirebase to your notifiable entity, witch returns device id.

 /**  * It could be one device  */ public function routeNotificationForFirebase() { return $this->device_id; } /**  * Or you can return array for multicast  */ public function routeNotificationForFirebase() { return $this->devices()->get()->pluck('id'); }

In Notification entity you should add firebase to via() method.

 public function via(): array { return ['firebase', /* 'email', 'database', 'etc...'*/]; }

And you can construct CloudMessage into toFirebase() method.

 public function toFirebase(): Messaging\CloudMessage $notification = Messaging\Notification::create('I <3 laravel', 'It is true'); return Messaging\CloudMessage::new()->withNotification($notificatin); }

Please look into the official PHP SDK documentation for the full use of all possibilities.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固