2017 © Pedro Peláez
 

library laravel-firebase

Firebase notification for laravel 5.2

image

alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  • Thursday, November 30, 2017
  • by alfa6661
  • Repository
  • 3 Watchers
  • 8 Stars
  • 2,299 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 1 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

laravel-firebase

StyleCI Total Downloads Latest Stable Version Latest Unstable Version, (*1)

Google Firebase Notification for Laravel, (*2)

This package makes it easy to send Firebase Notification with Laravel, (*3)

Installation

You can install the package via composer:, (*4)

``` bash composer require alfa6661/laravel-firebase, (*5)


You must install the service provider: ```php // config/app.php 'providers' => [ ... Alfa6661\Firebase\FirebaseServiceProvider::class, ],

Setting up your Firebase account

Add your Firebase Key to your config/services.php:, (*6)

// config/services.php
...
'firebase' => [
    'api_key' => env('FIREBASE_API_KEY'),
],
...

Usage

Now you can use the channel in your via() method inside the notification:, (*7)

``` php use Alfa6661\Firebase\FirebaseChannel; use Alfa6661\Firebase\FirebaseMessage; use Illuminate\Notifications\Notification;, (*8)

class CreditWasCreated extends Notification { public function via($notifiable) { return [FirebaseChannel::class]; }, (*9)

public function toFirebase($notifiable)
{
    return FirebaseMessage::create()
        ->title('Title')
        ->body('Push notification body')
        ->data(['id' => $notifiable->id]);
}

}, (*10)


In order to let your Notification know which device user(s) you are targeting, add the `routeNotificationForFirebase` method to your Notifiable model. You can either return a single device token, or if you want to notify multiple device just return an array containing all devices. ```php public function routeNotificationForFirebase() { return ["DEVICE_TOKEN", "DEVICE_TOKEN"]; }

The Versions

30/11 2017

dev-master

9999999-dev https://github.com/alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  Sources   Download

MIT

The Requires

 

The Development Requires

30/11 2017

2.1.1

2.1.1.0 https://github.com/alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  Sources   Download

MIT

The Requires

 

The Development Requires

19/10 2017

2.1

2.1.0.0 https://github.com/alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  Sources   Download

MIT

The Requires

 

The Development Requires

03/11 2016

2.0

2.0.0.0 https://github.com/alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  Sources   Download

MIT

The Requires

 

The Development Requires

29/08 2016

5.2.x-dev

5.2.9999999.9999999-dev https://github.com/alfa6661/laravel-firebase

Firebase notification for laravel 5.2

  Sources   Download

MIT

The Requires

 

The Development Requires