2017 © Pedro Peláez
 

library laravel-fcm

Package to send Firebase notification cross Laravel Application

image

idstack/laravel-fcm

Package to send Firebase notification cross Laravel Application

  • Saturday, November 18, 2017
  • by idstack
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Simple Laravel FCM

Simple package for using FCM as Push Notification. With multiple token or device ID and send with topics., (*1)

Installation

You can pull the package via composer :, (*2)

``` bash $ composer require idstack/laravel-fcm, (*3)


Register the service provider : ``` php 'Providers' => [ ... Idstack\Fcm\FcmServiceProvider::class, ] ``` Optional using facade: ```php 'aliases' => [ ... 'Fcm' => Idstack\Fcm\Facades\Fcm::class, ];

Publish the config file to define your server key :, (*4)

php artisan vendor:publish --provider="Idstack\Fcm\FcmServiceProvider"

This is the contents of the published file:, (*5)

return [
    /**
     * Insert your FCM Server Key Here
     * Or you can add in env file with FCM_SERVER_KEY variable
     */
    'fcm_server_key' => env('FCM_SERVER_KEY','')
];

Usage

This sample usage for sending notification to any devices with several information like title and body notification :, (*6)

fcm()
    ->data([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->to($recipients); // $recipients must an array

This sample usage for sending notification using topics with several information like title and body notification :, (*7)

fcm()
    ->data([
        'title' => 'Test FCM',
        'body' => 'This is a test of FCM',
    ])
    ->toTopics($recipients); // $recipients must an array

The Versions

18/11 2017

dev-master

9999999-dev

Package to send Firebase notification cross Laravel Application

  Sources   Download

MIT

The Requires

 

by Hakim SM

18/11 2017

1.0.0

1.0.0.0

Package to send Firebase notification cross Laravel Application

  Sources   Download

MIT

The Requires

 

by Hakim SM