Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-04-19 (5 months ago) | Not enough user ratings | Total: 27 | All time: 11,180 This week: 73 |
Version | License | PHP version | Categories | |||
php-slack 1.0.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 (21) |
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 (21) | / | src |
File | Role | Description | ||
---|---|---|---|---|
BlockKit (5 files, 2 directories) | ||||
Exception (1 file) | ||||
Config.php | Class | Class source | ||
Slack.php | Class | Class source |
Files (21) | / | 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 (21) | / | src | / | BlockKit | / | BlockElements |
File | Role | Description |
---|---|---|
AbstractObject.php | Class | Class source |
ButtonObject.php | Class | Class source |
Files (21) | / | src | / | BlockKit | / | CompositionObjects |
File | Role | Description |
---|---|---|
AbstractObject.php | Class | Class source |
AccessoryObject.php | Class | Class source |
TextObject.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.