Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

larafirebase

> 后端框架
Open source

Laravel Firebase Cloud Messaging. ✍️ Developed by Gentrit Abazi.

371 stars0 likes1 views
WebsiteGitHub

About

Laravel Firebase Cloud Messaging. ✍️ Developed by Gentrit Abazi.

Introduction

Larafirebase is a package thats offers you to send push notifications or custom messages via Firebase in Laravel.

Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.

For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.

Installation

Follow the steps below to install the package.

Composer

composer require kutia-software-company/larafirebase

Copy Config

Run php artisan vendor:publish --provider="Kutia\Larafirebase\Providers\LarafirebaseServiceProvider" to publish the larafirebase.php config file.

Get Athentication Key

Get Authentication Key from https://console.firebase.google.com/

Configure larafirebase.php as needed

'authentication_key' => '{AUTHENTICATION_KEY}'

Usage

Follow the steps below to find how to use the package.

Example usage in Controller/Service or any class:

…

Example usage in Notification class:

…

Tips

  • Check example how to receive messages or push notifications in a JavaScript client.
  • You can use larafirebase() helper instead of Facade.

Payload

Check how is formed payload to send to firebase:

Example 1:

php
Larafirebase::withTitle('Test Title')->withBody('Test body')->sendNotification('token1');
json
{
  "registration_ids": [
    "token1"
  ],
  "notification": {
    "title": "Test Title",
    "body": "Test body"
  },
  "priority": "normal"
}

Example 2:

php
Larafirebase::withTitle('Test Title')->withBody('Test body')->sendMessage('token1');
json
{
  "registration_ids": [
    "token1"
  ],
  "data": {
    "title": "Test Title",
    "body": "Test body"
  }
}

If you want to create payload from scratch you can use method fromRaw, for example:

php
return Larafirebase::fromRaw([
    'registration_ids' => ['token1', 'token2'],
    'data' => [
        'key_1' => 'Value 1',
        'key_2' => 'Value 2'
    ],
    'android' => [
        'ttl' => '1000s',
        'priority' => 'normal',
        'notification' => [
            'key_1' => 'Value 1',
            'key_2' => 'Value 2'
        ],
    ],
])->send();

Made with ♥ by Gentrit Abazi (@gentritabazi).

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPfirebasefirebase-cloud-messaginglarafirebaselaravel

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架