Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-04-19 (Yesterday) ![]() | Not yet rated by the users | Total: 3 This week: 3 | All time: 11,306 This week: 19![]() |
Version | License | PHP version | Categories | |||
php-slack 1.0 | MIT/X Consortium ... | 7 | Web services, Chat, PHP 7 |
Description | Author | |
This package can compose and send messages to a Slack channel. |
> Alas, I do not speak English, and the documentation was compiled through google translator :( > I will be glad if you can help me describe the documentation more correctly :)
The package can be installed via composer:
composer require yzen.dev/php-slack
Common use case:
$config = new Config(
url: 'https://hooks.slack.com/services/you-token',
username: 'YouProject',
channel: 'project-channel',
);
$slack = new Slack($config);
$slack->send([
HeaderBlock::create(TextObject::create(text: 'Test message')),
DividerBlock::create(),
SectionBlock::create(
fields: [
TextObject::createMarkdown(text: ":curly_haired_man:User:\n <https://github.com/yzen-dev|yzen.dev>"),
TextObject::createMarkdown(text: ":crown:Role:\n Creator"),
]
),
SectionBlock::create(
fields: [
TextObject::createMarkdown(text: ":calendar:When:\n `13.12.2021 23:33`"),
]
),
ActionsBlock::create(
elements: [
ButtonObject::create(
text: TextObject::create(text: "Open repository"),
url: 'https://github.com/yzen-dev/php-slack',
style: 'danger'
),
]
),
DividerBlock::create(),
]);
}
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
![]() |
/ | src |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
Class | Class source | ||
![]() |
Class | Class source |
![]() |
/ | src | / | BlockKit |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source |
![]() |
/ | src | / | BlockKit | / | BlockElements |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | src | / | BlockKit | / | CompositionObjects |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.