PHPackages                             andy-franklin/slack-app-messaging - 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. andy-franklin/slack-app-messaging

ActiveLibrary[API Development](/categories/api)

andy-franklin/slack-app-messaging
=================================

A package to allow quick building of messages and dialogs for use with the Slack api

12PHP

Since Nov 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Andy-franklin/slack-app-messaging)[ Packagist](https://packagist.org/packages/andy-franklin/slack-app-messaging)[ RSS](/packages/andy-franklin-slack-app-messaging/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Slack App Messaging
===================

[](#slack-app-messaging)

This package provides the basic building blocks of slack responses for use with the Slack API.

### Installation

[](#installation)

```
composer require andy-franklin/slack-app-messaging
```

### Building an interactive message

[](#building-an-interactive-message)

```
    public function sendLoginOrRegisterMessageResponse($responseUrl)
    {
        $message = new Message();
        $attachment = new Attachment();
        $loginAction = new Action();
        $registerAction = new Action();

        $loginAction
            ->setName('login')
            ->setText('Login to your Account')
            ->setType('button')
            ->setValue('login');

        $registerAction
            ->setName('register')
            ->setText('Register an Account')
            ->setType('button')
            ->setValue('register');

        $attachment
            ->setTitle('Your Slack account needs to be linked with your account to continue.')
            ->addAction($loginAction)
            ->addAction($registerAction)
            ->setCallbackId('loginRegister');

        $message->addAttachment($attachment);

        //POST this message as JSON to the responseUrl from the original Slack request
        $client = new Client();
        $response = $client->post($responseUrl, [
            'body' => $this->serializer->serialize($message, 'json')
        ]);
        return $response;
    }
```

An endpoint for the actions will need to be set up and the appropriate actions taken depending on the callbackId.

### Opening a Dialog

[](#opening-a-dialog)

```
    public function sendLoginDialog($triggerId)
    {
        //Build the dialog with a single username field.
        $textElement = new TextElement();
        $textElement
            ->setName('username')
            ->setLabel('Username')
            ->setPlaceholder('Enter your username')
            ->setHint('The username you have registered');
        $dialog = new Dialog();
        $dialog
            ->setTitle('Login')
            ->setCallbackId('submit-login')
            ->setSubmitLabel('Submit')
            ->addElement($textElement);

        //Add the triggerId from the initial Slack request
        $dialogResponse = new DialogResponse();
        $dialogResponse
            ->setTriggerId($triggerId)
            ->setDialog($dialog);

        //Generate a \GuzzleHttp\Psr7\Request
        $request = $dialogResponse->getPostRequest('dialog.open', $this->serializer, $this->slackXoxpToken);

        //Send this request
        $client = new Client();
        $response = $client->send($request);
    }
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37847329?v=4)[Andy-franklin](/maintainers/Andy-franklin)[@Andy-franklin](https://github.com/Andy-franklin)

---

Top Contributors

[![Andy-franklin](https://avatars.githubusercontent.com/u/37847329?v=4)](https://github.com/Andy-franklin "Andy-franklin (4 commits)")

### Embed Badge

![Health badge](/badges/andy-franklin-slack-app-messaging/health.svg)

```
[![Health](https://phpackages.com/badges/andy-franklin-slack-app-messaging/health.svg)](https://phpackages.com/packages/andy-franklin-slack-app-messaging)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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