PHPackages                             bubbaops/slack-php-framework - 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. bubbaops/slack-php-framework

ActiveLibrary

bubbaops/slack-php-framework
============================

Provides a foundation upon which to build a Slack application in PHP

117PHP

Since Mar 21Pushed 3y agoCompare

[ Source](https://github.com/BubbaOps/slack-php-framework)[ Packagist](https://packagist.org/packages/bubbaops/slack-php-framework)[ RSS](/packages/bubbaops-slack-php-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (1)Used By (0)

Slack App Framework for PHP
===========================

[](#slack-app-framework-for-php)

By Jeremy Lindblom ([@jeremeamia](https://twitter.com/jeremeamia))

Forked By Bubba Hines

 [![Slack PHP logo written in PHP's font](https://repository-images.githubusercontent.com/337916048/1ab9fb00-87f7-11eb-9eda-f25ffb705e87)](https://repository-images.githubusercontent.com/337916048/1ab9fb00-87f7-11eb-9eda-f25ffb705e87)

 [ ![Coded in PHP 7.4](https://camo.githubusercontent.com/b6b73f5e845b9cf54cf298e704f05a097d6288479f97231c49b65aa7dd9671e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652d706870253230372e342d3838393262662e737667) ](http://php.net/) [ ![Packagist Version](https://camo.githubusercontent.com/7cbcf8aebb709144ceb4ef607bd6e220cf8efcd28e10bb26a4a3b2ec479eda74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c61636b2d7068702f736c61636b2d6170702d6672616d65776f726b2e737667) ](https://packagist.org/packages/slack-php/slack-block-kit) [ ![Build Status](https://camo.githubusercontent.com/9e253cb650efb89bcb519bf34d4b9c9294fa8f8873c45da77febb710ab7db2b5/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246616374696f6e732d62616467652e6174726f782e646576253246736c61636b2d706870253246736c61636b2d7068702d6170702d6672616d65776f726b25324662616467652533467265662533446d61696e267374796c653d666c6174) ](https://actions-badge.atrox.dev/slack-php/slack-php-app-framework/goto?ref=main)

---

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

[](#introduction)

A PHP framework for building Slack apps. It takes inspiration from Slack's Bolt frameworks.

If you are new to Slack app development, you will want to learn about it on [Slack's website](https://api.slack.com/start). This library is only useful if you already understand the basics of building Slack applications.

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

[](#installation)

- Requires PHP 7.4+
- Use Composer to install: `composer require slack-php/slack-app-framework`

General Usage
-------------

[](#general-usage)

### Quick Warning

[](#quick-warning)

This library has been heavily dogfooded, but the project is severely lacking in test coverage and documentation, so use it at your own risk, as the MIT license advises.

- Contributions welcome (especially for documentation and tests).
- For questions, feedback, suggestions, etc., use [Discussions](https://github.com/slack-php/slack-php-app-framework/discussions).
- For issues or concerns, use [Issues](https://github.com/slack-php/slack-php-app-framework/issues).

### Development Patterns

[](#development-patterns)

When creating an app, you can configure your app from the Slack website. The framework is designed to recieve requests from all of your app's interaction points, so you should configure all of the URLs (e.g., in **Slash Commands**, **Interactivity &amp; Shortcuts** (don't forget the *Select Menus* section), and **Event Subscriptions**) to point to the root URL of your deployed app code.

When developing the app code, you declare one or more `Listener`s using the `App`'s routing methods that correspond to the different types of app interaction. `Listener`s can be declared as closures, or as objects and class names of type `BubbaOps\Framework\Listener`. A `Listener` receives a `Context` object, which contains the payload data provided by Slack to the app and provides methods for all the actions you can take to interact with or communicate back to Slack.

Quick Example
-------------

[](#quick-example)

This small app responds to the `/cool` slash command.

> Assumptions:
>
> - You have required the Composer autoloader to enable autoloading of the framework files.
> - You have set `SLACK_SIGNING_KEY` in the environment (e.g., `putenv("SLACK_SIGNING_KEY=foo");`)

```
