Download the PHP package kz370/laravel-firebase-notifications without Composer

On this page you can find all versions of the php package kz370/laravel-firebase-notifications. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-firebase-notifications

🚀 kz370/laravel-firebase-notifications

A simple and flexible Laravel package for sending Firebase Cloud Messaging (FCM) notifications using a Firebase Service Account. Supports both direct (instant) and queued (asynchronous) notifications — including topic-based broadcasts.


🧩 Features


📦 Installation

Install via Composer:


⚙️ Configuration

Publish the configuration file:

This creates config/firebase-notifications.php.

.env Setup

Add your Firebase credentials and project ID:

💡 Tip: Download your Firebase service account key from Project Settings → Service Accounts → Generate New Private Key


🚀 Usage Examples

Send Notification to a Specific Device

Method: sendNotification()

This method sends a push notification directly to a specific device using its FCM device token.

Parameters:

Parameter Type Required Description
$deviceToken string The Firebase device token that identifies a specific user's device. You typically get this from your mobile app's Firebase SDK.
$title string The title text of the notification, usually displayed in bold (e.g., "New Message").
$body string The main message content or body text of the notification.
$imageUrl string\|null (Optional) URL of an image to display in the notification if supported by the client app.
$data array (Optional) A custom key-value data payload sent alongside the notification. Useful for deep links or background processing.

Send Notification to a Topic

You can send notifications to any topic your users have subscribed to. By default, the topic is "all" — but you can specify your own.

This will send the notification to all users subscribed to the topic news.

Method: sendNotificationToTopic()

Parameters:

Parameter Type Required Description
$title string The notification title shown in the header (e.g., "System Update")
$body string The main notification body text (e.g., "We're upgrading our system tonight.")
$imageUrl string\|null Optional image URL to display in the notification (if supported)
$data array Custom key-value payload for background handling or deep linking
$topic string Target topic (default: "all")

⏳ Using Queues

You can queue notifications for background processing using Laravel's queue system.

Queue Single Device Notification

Queue Topic Notification

Delay Notification

Make sure your queue worker is running:


⚡ Configuration Overview

config/firebase-notifications.php


🧰 Troubleshooting

invalid_grant or unauthorized_client

Check that your Firebase service account JSON file is valid and the .env path is correct.

Notification not delivered

Queues not processing

Run your queue worker:


🪪 License

This package is open-source software licensed under the MIT License.


✨ Author

KZ370
💻 Laravel Developer


All versions of laravel-firebase-notifications with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0|^11.0
firebase/php-jwt Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kz370/laravel-firebase-notifications contains the following files

Loading the files please wait ...