maartenpaauw/php-slack-constants

PHP enums for Slack API events

1.1.0 2025-08-05 20:51 UTC

This package is auto-updated.

Last update: 2025-08-05 21:26:24 UTC


README

Latest Version on Packagist Tests Total Downloads

This package provides a PHP string-backed enum for the Slack API events with full support for the Events API and RTM API. The package helps you maintain consistency by preventing typos and provides context about each event, such as whether it's supported by certain APIs.

Support Me

Model States for Filament

You can support me by buying Model States for Filament.

Installation

You can install the package via composer:

composer require maartenpaauw/php-slack-constants

Usage

Events

The Events class provides a strongly typed way to work with Slack API events while providing context about API support.

use Maartenpaauw\Slack\Constants\Events;

Events::AppMention->value; // app_mention
Events::AppMention->supportsEventsApi(); // true
Events::AppMention->supportsRtmApi(); // false

Scopes

The Scopes class provides a strongly typed way to work with Slack API token scopes that define permissions needed for API calls.

use Maartenpaauw\Slack\Constants\Scopes;

Scopes::BookmarksRead->value; // bookmarks:read
Scopes::BookmarksRead->supportsApplicationLevelTokens(); // false
Scopes::BookmarksRead->supportsBotTokens(); // true
Scopes::BookmarksRead->supportsConfigurationTokens(); // false
Scopes::BookmarksRead->supportsUserTokens(); // true

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.