Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (21) | Download .zip | 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(),
]);
}
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (2 files, 2 directories) | ||||
tests (1 file) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
phpcs.xml | Data | Auxiliary data | ||
phpstan.neon | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
BlockKit (5 files, 2 directories) | ||||
Exception (1 file) | ||||
Config.php | Class | Class source | ||
Slack.php | Class | Class source |
Files | / | src | / | BlockKit |
File | Role | Description | ||
---|---|---|---|---|
BlockElements (2 files) | ||||
CompositionObjects (3 files) | ||||
AbstractBlock.php | Class | Class source | ||
ActionsBlock.php | Class | Class source | ||
DividerBlock.php | Class | Class source | ||
HeaderBlock.php | Class | Class source | ||
SectionBlock.php | Class | Class source |
Files | / | src | / | BlockKit | / | BlockElements |
File | Role | Description |
---|---|---|
AbstractObject.php | Class | Class source |
ButtonObject.php | Class | Class source |
Files | / | src | / | BlockKit | / | CompositionObjects |
File | Role | Description |
---|---|---|
AbstractObject.php | Class | Class source |
AccessoryObject.php | Class | Class source |
TextObject.php | 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.