定制 oscarweb/laravel-discord-report 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

oscarweb/laravel-discord-report

最新稳定版本:0.2.5

Composer 安装命令:

composer require oscarweb/laravel-discord-report

包简介

Discord Report - Log Error.

README 文档

README

It is a package to send errors that are logged in the Laravel application directly to a Discord channel.

- Install vía Composer

composer require oscarweb/laravel-discord-report

Or you can add this line to your composer.json file:

"oscarweb/laravel-discord-report": "^0.2.5"

and run

composer update

- Publish the service provider

php artisan vendor:publish --provider "LaravelDiscordReport\ServiceProvider"

- Add a Webhook

In your .env file you need to add the environment variable.

LDR_WEBHOOK_URL="https://discord.com/api/webhooks/.../..."

- Add Channel

You must add the new channel to your configuration file:

laravel_discord_report

# /config/logging.php

return [
    /** ... */
    'default' => env('LOG_CHANNEL', 'stack'),
    /** ... */
    'channels' => [
        'stack' => [
            'driver' => 'stack',
            //add channel: laravel_discord_report ↓
            'channels' => ['single','laravel_discord_report'],
            'ignore_exceptions' => false,
        ],

- Save Config

php artisan config:cache

- Testing

Example Command

Other environment variables

You can add these variables in your .env file

Name Description Default
LDR_DISABLED Disable sending messages to Discord. false
LDR_WEBHOOK_URL Discord channel webhook URL. null
LDR_WEBHOOK_USERNAME Name of the bot in the Discord channel. null
LDR_WEBHOOK_AVATAR Image URL for the bot avatar. null

- Example in your .env file:

LDR_WEBHOOK_URL="https://discord.com/api/webhooks/.../..."
LDR_WEBHOOK_USERNAME="Test API Report"
LDR_WEBHOOK_AVATAR="https://i.imgur.com/oBPXx0D.png"

Save config:

php artisan config:cache

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-17