承接 usmonaliyev/laravel-telegram-notifier 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

usmonaliyev/laravel-telegram-notifier

最新稳定版本:v1.4.1

Composer 安装命令:

composer require usmonaliyev/laravel-telegram-notifier

包简介

This package send errors and messages to your telegram group or chat.

README 文档

README

This package send bugs and messages to your telegram group or chat.

Packagist Dependency Version Total Downloads Latest Version on Packagist Packagist License

Screenshots

App Screenshot

Installation

Install this project with composer

composer require usmonaliyev/laravel-telegram-notifier

To control it, create config file

php artisan vendor:publish --provider="Usmonaliyev\LaravelTelegramNotifier\LaravelTelegramNotifierServiceProvider"

Add your bot token and receiver chat id to .env file.

TELEGRAM_NOTIFIER_BOT_TOKEN=
CHAT_ID=
TELEGRAM_NOTIFIER_RESPONSIBLE=@someone

I recommend that you only use it on production. To do this, change the value of TELEGRAM_NOTIFIER_ENABLED in .env to production.

TELEGRAM_NOTIFIER_ENABLED=false

Custom usage

If you want to send custom message, there is notify function:

<?php

use Usmonaliyev\LaravelTelegramNotifier\Facades\TelegramNotifier;

TelegramNotifier::notify("There is your text")

Also, there is error function to send handled error:

<?php

use Usmonaliyev\LaravelTelegramNotifier\Facades\TelegramNotifier;

try {
    ...
} catch (Exception $exception) {

    TelegramNotifier::error($exception);
}

Configuration

There are laravel-telegram-notifier.php in your config folder. If you want to send bag to two or three chat ids you add chat id to chat_ids array of laravel-telegram-notifier.php file.

"chat_ids" => [env("CHAT_ONE_ID"), env("CHAT_TWO_ID"), env("CHAT_THREE_ID")],

Running Tests

To verify that the package is fully installed and working. You can run the command below which will help you create a new dummy error.

php artisan notify:check

In production mode you can load configurations from .env with php artisan config:clear command.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-31