Package for Laravel notifications to Bitrix24
pascallieverse/laravel-bitrix24-notification is a Laravel package for package for laravel notifications to bitrix24.
It currently has 4 GitHub stars and 2.729 downloads on Packagist (latest version 1.6).
Install it with composer require pascallieverse/laravel-bitrix24-notification.
Discover more Laravel packages by pascallieverse
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to send notifications using the Bitrix Bot Platform with Laravel.
You can install the package via composer:
composer require "pascallieverse/laravel-bitrix24-notification"
And finally publish the config file:
php artisan vendor:publish --provider="PascalLieverse\Bitrix24\Bitrix24ServiceProvider"
Now you can create a simple notification as follows:
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use PascalLieverse\Bitrix24\Bitrix24Channel;
use PascalLieverse\Bitrix24\Bitrix24Message;
class BitrixNotice extends Notification
{
/**
* Create a new notification instance.
*/
public function __construct()
{
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [Bitrix24Channel::class];
}
/**
* Get the message.
*
* @param mixed $notifiable
* @return Bitrix24Message
*/
public function toBitrix24($notifiable)
{
return (new Bitrix24Message())->text("Bitrix notification message!");
}
}
The notification channel expects the user or chat ID to be passed. For example if the bitrix user ID is 1:
Notification::send(new Bitrix24Notifiable('1'), new BitrixNotice());
Or if the chat ID is 1:
Notification::send(new Bitrix24Notifiable('chat1'), new BitrixNotice());
MIT License (MIT). Freely redistributable product.