Download the PHP package paxha/laravel-fcm without Composer

On this page you can find all versions of the php package paxha/laravel-fcm. 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-fcm

Laravel FCM (Firebase Cloud Messaging) HTTP v1 API

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Introduction

This package provides (Laravel Notification) channels for sending notifications via FCM (Firebase Cloud Messaging) using HTTP v1 API. For more information about the Firebase Cloud Messaging HTTP v1 API, please refer to the official documentation: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages

Installation

To get started, you need to install the package via Composer:

Optional: Once the package is installed, you can publish the configuration file using the following command:

This will create a new fcm.php file in your config directory, where you can configure your FCM settings. If you don't publish it, it will create a default channel named fcm with the default configuration.

Configuration

You can configure your FCM settings in the fcm.php file. Here's an example of the default configuration:

You can also set your FCM settings in your .env file:

Please put your service account file at config folder and set the filename with path in the .env file.

You can create a service account file from the Google Cloud Console. For more information, please refer to the official: https://cloud.google.com/iam/docs/service-accounts-create

Usage

To send a notification, you can use the channel provided by this package. Here's an example of how to send a notification using the fcm channel:

Before sending the notification, you need to use our HasPushToken trait in your notifiable model.

Create a new notification using the following command:

Post Sending Notification

After sending the notification, it will call an event, and you can listen to the event to get the response of the notification. And you can also do some other stuff after sending the notification.

In your EventServiceProvider:

In your PostNotificationListener:

Cleaning up unused services OPTIONAL

There are 200+ Google API services. The chances are good that you will not want them all. In order to avoid shipping these dependencies with your code, you can run the Google\Task\Composer::cleanup task and specify the services you want to keep in composer.json:

This example will remove all services other than "FirebaseCloudMessaging" when composer update or a fresh composer install is run.

IMPORTANT: If you add any services back in composer.json, you will need to remove the vendor/google/apiclient-services directory explicitly for the change you made to have effect:


All versions of laravel-fcm with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
google/apiclient Version ^2.15
ext-json Version *
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 paxha/laravel-fcm contains the following files

Loading the files please wait ....