dealnews/slack

Slack PHP Library

Maintainers

Package info

github.com/dealnews/slack

pkg:composer/dealnews/slack

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

2.0.1 2025-11-09 04:22 UTC

README

A library for sending simple messages to Slack from PHP. We have used this internally for years. The other options out there seem to be out of date and no longer supported.

Send a Message

use DealNews\Slack\Message;

// Send a simple text message
$message = new Message($hook_url);
$message->send("channel", "message");

// Send a formatted message
$message->send(
    "channel",
    [
        'fallback' => 'Some fallback text for older clients',
        'color'    => '#dadada',
        'fields'   => [
            [
                'title' => 'Test',
                'value' => 'testing',
                'short' => true,
            ],
        ],
        'pretext'     => 'pretext',
        'author_name' => 'author',
        'author_link' => 'http://www.example.com/',
        'author_icon' => 'http://www.example.com/example.jpg',
        'title'       => 'title',
        'title_link'  => 'http://www.example.com/',
        'text'        => 'text',
        'image_url'   => 'http://www.example.com/example.jpg',
        'thumb_url'   => 'http://www.example.com/example.jpg',
    ]
);