vanlonden / pusher by vanlonden

Firebase wrapper library for Laravel
18
0
3
Package Data
Maintainer Username: vanlonden
Maintainer Contact: jordy.vanlonden@gmail.com (Jordy van Londen)
Package Create Date: 2016-08-03
Package Last Update: 2016-08-16
Language: PHP
License: Unknown
Last Refreshed: 2025-02-08 15:05:06
Package Statistics
Total Downloads: 18
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Pusher

Setup

  1. run composer require vanlonden/pusher
  2. add VanLonden\Pusher\PusherServiceProvider::class, to the providers in config/app.php
  3. run artisan vendor:publish
  4. edit config/pusher.php to your liking
  5. add your FIREBASE_SERVER_KEY to your .env file
  6. run artisan migrate

Usage

// Send a push message to all users
$this->pusher->send('Title', 'A message', User::all());

// Create a future push message
$futurePush = FuturePush::create([
    'time' => '2016-08-03 17:00',
    'title' => 'Title',
    'message' => 'A message',
]);
$futurePush->users()->saveMany(User::all());

// Send a future push message
$this->pusher->sendFuture(FuturePush::first());