Pusher
Setup
- run
composer require vanlonden/pusher
- add
VanLonden\Pusher\PusherServiceProvider::class,
to the providers
in config/app.php
- run
artisan vendor:publish
- edit
config/pusher.php
to your liking
- add your
FIREBASE_SERVER_KEY
to your .env file
- 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());