sukristyan/laravel-slack-sender 问题修复 & 功能扩展

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

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

sukristyan/laravel-slack-sender

最新稳定版本:1.0.0

Composer 安装命令:

composer require sukristyan/laravel-slack-sender

包简介

Simple and flexible Slack message sender for Laravel applications.

README 文档

README

Laravel Slack Sender is a simple and flexible package for sending messages to Slack from your Laravel application. It leverages Slack Incoming Webhooks for fast and easy message delivery.

Features

  • 🚀 Easy to use with fluent syntax.
  • 🔗 Supports Slack Incoming Webhooks.
  • 💬 Send simple text messages.
  • 📎 Supports attachments for rich messages.
  • 📢 Specify custom channels (if allowed by webhook configuration).

Requirements

  • PHP ^8.2
  • Laravel Framework

Installation

You can install the package via Composer:

composer require sukristyan/laravel-slack-sender

Usage

Ensure you have a Slack Incoming Webhook URL. If you don't have one, you can create it in the Slack App Management page.

Basic Usage

Here is an example of how to send a simple message:

use Sukristyan\Messaging\Slack;

$webhookUrl = 'XXXXXXXXXXXXXXXXXXXXXXXX';

Slack::webhook($webhookUrl)
    ->message('Hello! This is a test message from Laravel.')
    ->send();

Sending to a Specific Channel

You can override the default channel configured in the webhook (if allowed):

Slack::webhook($webhookUrl)
    ->channel('#random') // optional
    ->message('This message is sent to the #random channel.')
    ->send();

Sending Messages with Attachments

You can send richer messages using attachments:

Slack::webhook($webhookUrl)
    ->message('Daily Report') // optional
    ->attachments([
        [
            'color' => '#36a64f',
            'title' => 'Server Status',
            'text' => 'All systems are operational.',
            'fields' => [
                [
                    'title' => 'CPU Load',
                    'value' => '15%',
                    'short' => true
                ],
                [
                    'title' => 'Memory Usage',
                    'value' => '320MB',
                    'short' => true
                ]
            ]
        ]
    ])
    ->send();

License

The sukristyan/laravel-slack-sender package is open-sourced software licensed under the MIT LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固