PHPackages                             eric-famiglietti/laravel-slack-events - 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. eric-famiglietti/laravel-slack-events

ActiveLibrary[API Development](/categories/api)

eric-famiglietti/laravel-slack-events
=====================================

Laravel package for integrating with the Slack Events API

1.0.0(8y ago)1310MITPHPPHP ^7.1

Since Mar 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/eric-famiglietti/laravel-slack-events)[ Packagist](https://packagist.org/packages/eric-famiglietti/laravel-slack-events)[ Docs](https://github.com/eric-famiglietti/laravel-slack-events)[ RSS](/packages/eric-famiglietti-laravel-slack-events/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Laravel Slack Events
====================

[](#laravel-slack-events)

[![Packagist](https://camo.githubusercontent.com/a4d4ecdb9afdc35cfe2562ba52fe303d6d61f4147672d403ebaaa732272ca8f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657269632d66616d69676c69657474692f6c61726176656c2d736c61636b2d6576656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eric-famiglietti/laravel-slack-events)[![Travis](https://camo.githubusercontent.com/c9682dcf6ddfe779dcd2bcb19ac17b359dcd726eea6ac623bf3a9cf4a2eac441/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f657269632d66616d69676c69657474692f6c61726176656c2d736c61636b2d6576656e74732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/eric-famiglietti/laravel-slack-events)[![StyleCI](https://camo.githubusercontent.com/41c1a038ad57dc93e837f3d4b050b50b90e607adb5ca63efdc24a753042bdced/68747470733a2f2f7374796c6563692e696f2f7265706f732f3132343831343730362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/124814706)

Laravel package for integrating with the [Slack Events API](https://api.slack.com/events-api).

Introduction
------------

[](#introduction)

This package makes it easy to set up a webhook in a Laravel application for receiving requests from Slack through the [Slack Events API](https://api.slack.com/events-api). The package handles token authentication and URL verification and leaves the specific handling of events up to you. Events can be handled through jobs or event listeners.

Before proceeding, it's recommended that you familiarize yourself with the [Slack Events API](https://api.slack.com/events-api) and the available [Event Types](https://api.slack.com/events/api) so you can properly set up Slack to communicate with your application.

Requirements
------------

[](#requirements)

- PHP 7.1 or above
- Laravel 5.6

**NOTE:** These requirements are artificially high. The package could work with earlier versions of Laravel but has only been tested with Laravel 5.6.

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

[](#installation)

Install the latest version using [Composer](https://getcomposer.org/):

```
$ composer require eric-famiglietti/laravel-slack-events

```

Publish the configuration file using:

```
$ php artisan vendor:publish --provider="LaravelSlackEvents\SlackEventsServiceProvider" --tag="config"

```

Usage
-----

[](#usage)

### Setup

[](#setup)

The package requires a `SLACK_EVENTS_TOKEN` environmental variable to be set. The *Verification Token* can be found by on your Slack application's dashboard ([https://api.slack.com/apps/&lt;app\_id&gt;](https://api.slack.com/apps/%3Capp_id%3E)), under the *App Credentials* section.

For the purpose of this guide, the webhook URL that we will use is `https://app.tld/slack/events`.

First, create the webhook route using the route macro:

```
Route::slackEventsWebhook('slack/events');
```

Next, add the route to the `$except` array of the `VerifyCsrfToken` middleware:

```
protected $except = [
    'slack/events',
];
```

Once you have created the webhook, configure Slack to send event requests to the webhook. This is done on the Event Subscriptions page ([https://api.slack.com/apps/&lt;app\_id&gt;/event-subscriptions](https://api.slack.com/apps/%3Capp_id%3E/event-subscriptions)) of your Slack application's dashboard.

If your application is publically accessible, you will begin to event requests to the webhook. Events can be handled through jobs or event listeners.

### Jobs

[](#jobs)

Jobs can be executed when events are triggered. For example, to dispatch a job when a `reaction_added` is received, add the following to `config/slack-events.php`:

```
'jobs' => [
    'reaction_added' => \App\Jobs\SlackEvents\HandleReactionAdded::class,
],
```

Jobs will receive the event payload through their constructor:

```
namespace App\Jobs\SlackEvents;

class HandleReactionAdded
{
    public $payload;

    public function __construct(array $payload)
    {
        $this->payload = $payload;
    }

    public function handle()
    {
        // ...
    }
}
```

### Events

[](#events)

Laravel event listeners can handle Slack event requests. For example, to listen to a `reaction_added` event, add an element to the `$listen` property of your `EventServiceProvider`:

```
protected $listen = [
    'slack-events::reaction_added' => [
        App\Listeners\SlackEvents\ReactionAddedListener::class,
    ],
];
```

The associated event listener would look like:

```
namespace App\Listeners\SlackEvents;

class ReactionAddedListener
{
    public function handle(array $payload)
    {
        // ...
    }
}
```

Testing
-------

[](#testing)

Run the included tests using:

```
$ vendor/bin/phpunit

```

Credits
-------

[](#credits)

Special thanks to the [ohdearapp/laravel-ohdear-webhooks](https://github.com/ohdearapp/laravel-ohdear-webhooks) package, which this package was heavily based on.

License
-------

[](#license)

This package is provided under the MIT License (MIT). See the [license file](LICENSE) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3036d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/751204?v=4)[Eric Famiglietti](/maintainers/eric-famiglietti)[@eric-famiglietti](https://github.com/eric-famiglietti)

---

Top Contributors

[![eric-famiglietti](https://avatars.githubusercontent.com/u/751204?v=4)](https://github.com/eric-famiglietti "eric-famiglietti (15 commits)")

---

Tags

laravelslackevents api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eric-famiglietti-laravel-slack-events/health.svg)

```
[![Health](https://phpackages.com/badges/eric-famiglietti-laravel-slack-events/health.svg)](https://phpackages.com/packages/eric-famiglietti-laravel-slack-events)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k11.8M117](/packages/nuwave-lighthouse)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[intervention/image-laravel

Laravel Integration of Intervention Image

1588.9M186](/packages/intervention-image-laravel)

PHPackages © 2026

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