artarts36/pushall-sender

0.3.4 2021-05-24 23:12 UTC

This package is auto-updated.

Last update: 2024-11-29 06:04:06 UTC


README

PHP Composer License: MIT Total Downloads

Description:

Client for send push-notifications on API https://pushall.ru

PushAll API Documentation: https://pushall.ru/blog/api

Installation:

composer require artarts36/pushall-sender

Examples:

Simple:

use ArtARTs36\PushAllSender\Senders\PushAllSender;
use ArtARTs36\PushAllSender\Push;

$sender = new PushAllSender(123456789, 'apiKey');
$push = new Push('Message #1', 'Hello');

$sender->push($push);

Connect in Laravel:

1*. Set variables in .env:

PUSHALL_API_KEY='your key'
PUSHALL_CHANNEL_ID='your channel id'

2*. Binding in bootstrap/app.php:

$app->singleton(
    \ArtARTs36\PushAllSender\Interfaces\PusherInterface::class,
    function () {
        return new ArtARTs36\PushAllSender\Senders\PushAllSender(env('PUSHALL_CHANNEL_ID'), env('PUSHALL_API_KEY'));
    }
);