PHPackages                             ontanj/slack-payload - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ontanj/slack-payload

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ontanj/slack-payload
====================

Extracts information from Slack payload

v1.0.0(8y ago)014MITPHP

Since Feb 1Pushed 8y agoCompare

[ Source](https://github.com/ontanj/slack-payload)[ Packagist](https://packagist.org/packages/ontanj/slack-payload)[ RSS](/packages/ontanj-slack-payload/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Payload
=======

[](#payload)

When using interactive messages in Slack's API, the result is returned as a json encoded array through `$_POST["payload"]`. This application helps extracting information from that payload.

Installation
------------

[](#installation)

`composer require ontanj/slack-payload`

Usage
-----

[](#usage)

The Payload class is in the namespace `SlackPayload`.

To instantiate the Payload class, pass `$_POST["payload"]` to the contructor. Now you can recieve the information by using functions of the object.

### Available functions

[](#available-functions)

```
/**
 * Gets callback id for the used attachment
 * @return string callback id
 */
public function callback_id() : string

/**
 * Gets id for the channel the message came from
 * @return string channel id
 */
public function channel_id() : string

/**
 * Gets name of the channel the message came from
 * @return string channel name
 */
public function channel_name() : string

/**
 * Gets the choice made, either selected list item or pressed button.
 * @return string value of choice
 */
public function choice() : string

/**
 * Gets the name of the menu where the list item was chosen.
 * If choice wasn't made from a list, the button value is returned.
 * @return string menu name
 */
public function menu_name() : string

/**
 * Gets the URL to return a response to
 * @return string URL
 */
public function response_url() : string

/**
 * Gets the id of the slack team where the message was sent from.
 * @return string team id
 */
public function team_id() : string

/**
 * Gets the name of the slack team where the message was sent from.
 * @return string team name
 */
public function team_name() : string

/**
 * Gets the id of the user performing the action
 * @return string user id
 */
public function user_id() : string

/**
 * Gets the name of the user performing the action
 * @return string user name
 */
public function user_name() : string

```

Future
------

[](#future)

The aim is to include more functions. Feel free to contribute.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3023d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e2df690cd64dcc69f0b4d9e2b7dfcb45765283e7ba0fc3700784b9e20a2f743?d=identicon)[ontanj](/maintainers/ontanj)

---

Top Contributors

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

---

Tags

slackslack-api

### Embed Badge

![Health badge](/badges/ontanj-slack-payload/health.svg)

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

PHPackages © 2026

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