frlnc/php-slack
最新稳定版本:1.0.3
Composer 安装命令:
composer require frlnc/php-slack
包简介
A lightweight PHP implementation of Slack's API.
关键字:
README 文档
README
A lightweight PHP implementation of Slack's API.
Provides
-
Frlnc\Slack\Contracts
A small set of contracts to allow for the consumption of the Slack API. Interactor, Response and ResponseFactory.
- Interactor is in charge of providing the Http GET/POST methods.
- Response is in charge of providing a simple Http response wrapper for holding the body, headers and status code.
- ResponseFactory is in charge of providing a factory to instantiate and build the Response.
To use this package, it's simple. Though please note that this implementation is very lightweight meaning you'll need to do some more work than usual. This package doesn't provide methods such as Chat::postMessage(string message), it literally provides one method (Commander::execute(string command, array parameters = [])).
Here is a very simple example of using this package:
<?php use Frlnc\Slack\Http\SlackResponseFactory; use Frlnc\Slack\Http\CurlInteractor; use Frlnc\Slack\Core\Commander; $interactor = new CurlInteractor; $interactor->setResponseFactory(new SlackResponseFactory); $commander = new Commander('xoxp-some-token-for-slack', $interactor); $response = $commander->execute('chat.postMessage', [ 'channel' => '#general', 'text' => 'Hello, world!' ]); if ($response['ok']) { // Command worked } else { // Command didn't work }
Note that Commander will automatically format most inputs to Slack's requirements but attachments are not supported - you will need to manually call $text = Commander::format($text) to convert it.
frlnc/php-slack 适用场景与选型建议
frlnc/php-slack 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.14M 次下载、GitHub Stars 达 129, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「slack」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 frlnc/php-slack 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 frlnc/php-slack 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 frlnc/php-slack 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Highly Opinionated Symfony3/4 Deployer Recipe
This bundle provides integration with the Slack API library, allowing you to interact with the Slack API from within your Symfony projects
Wrapper for Slack Web API
This is my package support-tickets-notifications
Console commands
Slack Blocks support for laravel notifications.
统计信息
- 总下载量: 1.14M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 131
- 点击次数: 20
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04