PHPackages                             flourishlabs/saloon-slack - 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. flourishlabs/saloon-slack

ActiveLibrary[API Development](/categories/api)

flourishlabs/saloon-slack
=========================

Saloon connectors/requests for Slack

0.0.4(3y ago)9112[2 PRs](https://github.com/flourishlabs/saloon-slack/pulls)MITPHPPHP ^8.1

Since Mar 10Pushed 2y agoCompare

[ Source](https://github.com/flourishlabs/saloon-slack)[ Packagist](https://packagist.org/packages/flourishlabs/saloon-slack)[ Docs](https://github.com/flourishlabs/saloon-slack)[ RSS](/packages/flourishlabs-saloon-slack/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

Saloon for Slack
================

[](#saloon-for-slack)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c7e10d8f1a68cd23aa357af3e48e7185558e7d6540e54b62f1b10ce4b60ba24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f75726973686c6162732f73616c6f6f6e2d736c61636b3f636f6c6f723d663238643161267374796c653d666c61742d737175617265)](https://packagist.org/packages/flourishlabs/saloon-slack)[![Tests](https://camo.githubusercontent.com/a0e0865ebdc1d3a9dd04bb318c4ae1aab0c6d340d290cd6280641e309b3de503/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666c6f75726973686c6162732f73616c6f6f6e2d736c61636b2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/flourishlabs/saloon-slack/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/5fd97379eb61f5dabc68d9487c69c6d4b3fe9c15e948c9fcdc11d4f8c772f955/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6f75726973686c6162732f73616c6f6f6e2d736c61636b2e7376673f636f6c6f723d663238643161267374796c653d666c61742d737175617265)](https://packagist.org/packages/flourishlabs/saloon-slack)

Introduction
============

[](#introduction)

The power of Slack powered by [Saloon](https://docs.saloon.dev/)

Installation
============

[](#installation)

Install the package via composer:

```
composer require flourishlabs/saloon-slack
```

Usage - API
===========

[](#usage---api)

Instance
--------

[](#instance)

Create an instance

```
use FlourishLabs\SaloonSlack\SlackConnector;

$slack = new SlackConnector('token');
```

Generic GET
-----------

[](#generic-get)

```
$response = $slack->get('users.info', ['user' => 'W1234567890']);

$response = $slack->get('admin.emoji.add', [
    'name' => 'pikachu_wave',
    'url' => 'https://emojis.slackmojis.com/emojis/images/1643514747/7550/pikachu_wave.gif?1643514747',
]);
```

Generic POST
------------

[](#generic-post)

```
$slack->post('chat.postEphemeral', [
    'channel' => 'C1234567890',
    'text' => 'Well howdy!',
    'user' => 'U0HH0WDY',
]);
```

---

Responses
---------

[](#responses)

The most useful method you'll need on a Response object is `json`:

```
$response->json('channel_id');
$response->json('message_ts')
```

[Saloon's documentation](https://docs.saloon.dev/the-basics/responses) is best for responses, but there are extra Slack specific methods available too.

- `hasWarning(): bool` &amp; `warning(): string`From [Slack docs](https://api.slack.com/web#slack-web-api__evaluating-responses): In the case of problematic calls that could still be completed successfully, ok will be true and the warning property will contain a short machine-readable warning code (or comma-separated list of them, in the case of multiple warnings). ```
    if ($response->hasWarning()) {
        Log::warning($response->warning());
    }
    ```
- `hasError(): bool` &amp; `error(): string`From [Slack docs](https://api.slack.com/web#slack-web-api__evaluating-responses) For failure results, the error property will contain a short machine-readable error code. ```
    if ($response->hasError()) {
        Log::error("Ah poo! {$response->error()}");
    }
    ```

Usage - OAuth
=============

[](#usage---oauth)

You can also interact with Slack's OAuth through the `SlackAuthConnector`.

Instance
--------

[](#instance-1)

Create an Auth instance

```
use FlourishLabs\SaloonSlack\SlackAuthConnector;

$oauth = new SlackAuthConnector(
    $clientId,
    $clientSecret,
    $redirectUri,
);
```

Generate auth URL
-----------------

[](#generate-auth-url)

You'll likely want to generate &amp; store `state` in session to verify during token exchange. You'll want to redirect the user to this authorization URL

```
$oauth->getSlackAuthorizationUrl(
    $botScopes,
    $userScopes,
);
```

Exchange
--------

[](#exchange)

If you need to access the bot *and* user token you should return the response.

```
$response = $oauth->getAccessToken(
    code: $request->get('code'),
    state: $request->get('state'),
    expectedState: $request->session()->get('slack.auth.state'),
    returnResponse: true,
);

$botToken = $response->json('access_token');
$userToken = $response->json('authed_user.access_token');
```

If you only need the bot token you can use the standard Saloon setup ([their docs](https://docs.saloon.dev/digging-deeper/oauth2-authentication#verifying-state)).

```
$authenticator = $oauth->getAccessToken($code, $state);
```

You can then use these tokens as normal to instantiate a SlackConnector.

```
use FlourishLabs\SaloonSlack\SlackConnector;

(new SlackConnector($response->json('access_token')))
->post('chat.postMessage', ['channel' => 'C123', 'text' => 'Cor, this is good eh']);
```

Testing
-------

[](#testing)

```
vendor/bin/pest
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Ashley Hindle](https://github.com/ashleyhindle)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.6% 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 ~0 days

Total

4

Last Release

1157d ago

PHP version history (2 changes)0.0.1PHP ^8.0

0.0.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd4c159dc60ca5c0140c772d3e633132790a95cc32dcfc355ce6644afaf78833?d=identicon)[ashleyhindle](/maintainers/ashleyhindle)

---

Top Contributors

[![ashleyhindle](https://avatars.githubusercontent.com/u/454975?v=4)](https://github.com/ashleyhindle "ashleyhindle (34 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

flourishlabssaloon-slack

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/flourishlabs-saloon-slack/health.svg)

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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