PHPackages                             clawrock/slack-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. clawrock/slack-api

ActiveLibrary[API Development](/categories/api)

clawrock/slack-api
==================

Slack Integration

1.6.0(8y ago)31.3kApache-2.0PHPPHP &gt;=5.5

Since Aug 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/clawrock/slack-api)[ Packagist](https://packagist.org/packages/clawrock/slack-api)[ Docs](http://clawrock.com/)[ RSS](/packages/clawrock-slack-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

Slack-API
=========

[](#slack-api)

Introduction
------------

[](#introduction)

Slack-API lets you build simple response system for slack's slash command API.

### Installation

[](#installation)

For production make sure you have composer installed. Then run:

```
composer require clawrock/slack-api
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

Code Examples
-------------

[](#code-examples)

Basic example with anonymous function.

```
use ClawRock\Slack\SlackFactory;

//Create new dispatcher
$dispatcher = SlackFactory::dispatcher();

//Add commands to respond to your request
$dispatcher->addCommand(SlackFactory::slashCommand('your-command-token')
          ->run(function ($req, $res){
                $res->addText('Hello world!');
          }))->dispatch(SlackFactory::getRequest())
      ->create()
      ->toRequest()
      ->serve();
```

You can also add Guard to manage the user/team/channel permissions.

```
use ClawRock\Slack\Enums\Permissions;

$dispatcher->addGuard(SlackFactory::guard()
        ->defaultBehavior(Permissions::DenyAll())
        ->allowUserIds(['U01'])
        ->allowTeamIds(['T01']))
    ->addCommand(//commands)
    ->dispatch(SlackFactory::getRequest())
    ->create()
    ->toRequest()
    ->serve();
```

It's worth to notice that ***every*** callable object can be used in addCommand() method.

You can send messages via [Incoming webhooks](https://api.slack.com/incoming-webhooks "Slack's API Reference")

```
use ClawRock\Slack\SlackFactory;

SlackFactory::getMessageService('')->sendText("Hello world!");
```

Documentation
-------------

[](#documentation)

There are very well documented examples in examples/ directory. You should take a look on them.

Tests
-----

[](#tests)

Simply run

```
vendor/bin/phpunit
```

### Requirements

[](#requirements)

Slack API requires server with SSL enabled. Please refer to the Slack's API [reference](https://api.slack.com/slash-commands#ssl) to get more informations.

### Contributing

[](#contributing)

If you wish to participate in the development, you may use grunt to generate the documentation files. To do so make sure you have node and npm installed.

```
$ node -v
v4.7.0
$ npm -v
2.15.11

```

Then run

```
$ npm install
$ grunt init
```

And then to generate docs run

```
grunt build
```

This will also launch unit tests.

Credits
-------

[](#credits)

Slack-API was initiated with [generator-composer](https://github.com/T1st3/generator-composer), a [Yeoman](http://yeoman.io) generator that builds a PHP Composer project.

This project uses the following as development dependencies:

- [PHPUnit](http://phpunit.de/)
- [PhpDocumentor](http://phpdoc.org)
- [Php Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd)

License
-------

[](#license)

Author: cr-team

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

4

Last Release

3047d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19371023?v=4)[ClawRock](/maintainers/clawrock)[@clawrock](https://github.com/clawrock)

---

Top Contributors

[![golaod](https://avatars.githubusercontent.com/u/1168071?v=4)](https://github.com/golaod "golaod (4 commits)")

---

Tags

slackintegrationclawrock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clawrock-slack-api/health.svg)

```
[![Health](https://phpackages.com/badges/clawrock-slack-api/health.svg)](https://phpackages.com/packages/clawrock-slack-api)
```

###  Alternatives

[jolicode/slack-php-api

An up to date PHP client for Slack's API

2534.4M12](/packages/jolicode-slack-php-api)[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

74855.8k1](/packages/wordpress-mcp-adapter)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[botman/driver-slack

Slack driver for BotMan

51267.0k2](/packages/botman-driver-slack)[mpociot/slack-client

A better Slack client, with RTM API support

51263.6k1](/packages/mpociot-slack-client)[lygav/php-slackbot

Simple, easy to use, PHP package for sending messages to Slack. Send pretty, colourful messages with rich attachments quickly with this friendly API

39399.9k](/packages/lygav-php-slackbot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
