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 today

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 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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://www.gravatar.com/avatar/7d416e50490450eb97f0974659736908dac46110775b874644adcedcbcce16e5?d=identicon)[Andy-franklin](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[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/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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