pascallieverse/laravel-bitrix24-notification 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pascallieverse/laravel-bitrix24-notification

Composer 安装命令:

composer require pascallieverse/laravel-bitrix24-notification

包简介

Package for Laravel notifications to Bitrix24

README 文档

README

This package makes it easy to send notifications using the Bitrix Bot Platform with Laravel.

Installation

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"

Setting up your Bitrix24 bot

  1. Inside bitrix24 navigate to: Extensions -> Applications -> Developer resources -> Add a chat bot -> Notify employees in the chat.
  2. Fill in the required fields to create the bot. The bot type should be "Chat bot, immediate response".
  3. Copy the "Webhook to call REST API" url and place this value inside your env file as BITRIX_WEBHOOK_URL.
  4. Copy the "Bot CLIENT_ID" and place this value inside your env as BITRIX_BOT_CLIENT_ID.

Usage

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());

License

MIT License (MIT). Freely redistributable product.

统计信息

  • 总下载量: 2.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固