tiagomichaelsousa/slack-laravel
最新稳定版本:v0.2.0
Composer 安装命令:
composer require tiagomichaelsousa/slack-laravel
包简介
A slack sdk for laravel
README 文档
README
Slack Laravel is a non-official PHP API package that allows you to interact with the Slack API ⚡️
This package is still under development. There may have methods that are still not implemented.
Get Started
The official documentation for the Slack Client will be available soon. 👀
Until there you can still explore the SDK development experience with the users(), conversations() and reminders() methods 🚀
Requires PHP 8.1+
First, install Slack Laravel via the Composer package manager:
composer require tiagomichaelsousa/slack-laravel
Next, publish the configuration file:
php artisan vendor:publish --provider="Slack\Laravel\ServiceProvider"
This will create a config/slack.php configuration file in your project, which you can modify to your needs
using environment variables:
SLACK_TOKEN=xoxb-...
Finally, you may use the Slack facade to access the Slack API:
use Slack\Laravel\Facades\Slack; $conversations = Slack::conversations()->create('foo'); echo $conversations->channel->name;
Usage
For usage examples, take a look at the tiagomichaelsousa/slack-client repository.
Testing
The Slack facade provides a fake() method that allows you to fake the API responses.
All responses are having a fake() method that allows you to easily create a response object by only providing the parameters relevant for your test case.
use Slack\Laravel\Facades\Slack; use Slack\Responses\Conversation\CreateConversationResponse; Slack::fake([ CreateConversationResponse::fake([ 'channel' => [ 'name' => 'foo', ], ]); ]); $conversations = Slack::conversations()->create('foo'); expect($conversations->channel)->name->toBe('foo');
The official documentation for the Slack Client for Laravel will be available soon. 👀
Slack Client for Laravel is an open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-29
