PHPackages                             syedaunn/laravel-slack-output - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. syedaunn/laravel-slack-output

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

syedaunn/laravel-slack-output
=============================

Sends a message to Slack when something goes wrong with your Laravel application.

v1.0.8(7y ago)024MITPHPPHP &gt;=5.5.9

Since Jan 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/syedaunn/Laravel-SlackOutput)[ Packagist](https://packagist.org/packages/syedaunn/laravel-slack-output)[ RSS](/packages/syedaunn-laravel-slack-output/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (10)Used By (0)

Laravel SlackOutput
===================

[](#laravel-slackoutput)

Sends messages to [Slack](https://slack.com) with your [Laravel](https://laravel.com) application.

This package provides:

- Post Command
    ------------

    [](#post-command)

    Send message to slack with a Laravel command.
- Stats Command
    -------------

    [](#stats-command)

    Send stats about your Laravel app with this customizable command.

    [![Stats on Slack](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/stats.png)](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/stats.png)
- Exceptions handler
    ------------------

    [](#exceptions-handler)

    Output to Slack useful information about exceptions when they occurred.

    [![Exception on Slack](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/exception.png)](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/exception.png)
- Failed jobs handler
    -------------------

    [](#failed-jobs-handler)

    Get alerted when a job failed.

    [![Job failed on Slack](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/jobOutput.png)](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/jobOutput.png)
- Scheduled commands reporting
    ----------------------------

    [](#scheduled-commands-reporting)

    Keep an eye on the result of your scheduled commands.

    [![Scheduled command on Slack](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/scheduledCommand.png)](https://raw.githubusercontent.com/syedaunn/Laravel-SlackOutput/master/screenshots/scheduledCommand.png)

Requirements
============

[](#requirements)

- Laravel 5.1 or greater
- PHP 5.5.9 or greater

Installation
============

[](#installation)

You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:

```
composer require syedaunn/laravel-slack-output
```

You need to include the service provider and the facade in your Laravel app.

Add the service provider to the `providers` array in `config/app.php`:

```
'providers' => [
  ...
  SyedAunn\SlackOutput\ServiceProvider::class,
],
```

and then add the facade to your `aliases` array:

```
'aliases' => [
  ...
  'SlackOutput' => SyedAunn\SlackOutput\Facade\SlackOutput::class,
],
```

Publish the configuration file with:

```
php artisan vendor:publish --provider="SyedAunn\SlackOutput\ServiceProvider"
```

You need to add the webhook URL to the configuration file in order for the package to post to Slack. [Create an incoming webhook](https://my.slack.com/services/new/incoming-webhook) on your Slack account. Copy the webhook url and open `config/slack-output.php` and set the webhook url to `endpoint`.

If `null` is set for any, the package will fall back on the default settings set by the webhook.

Usage
=====

[](#usage)

Post Command
------------

[](#post-command-1)

The command `slack:post` posts message to Slack. It can take as arguments:

- `message`: the message to send
- `to`: the channel or person to post to
- `attach`: the attachment payload

You can find information about the attach argument here:

You can call it by the running the command:

```
php artisan slack:post "Hello, I'm a bot" @nico
```

You can also call it in your Laravel app:

```
Artisan::queue('slack:post', [
  'to' => "#api-output",
  'attach' => $someAttachment,
  'message' => "Hello, I'm a bot"
]);
```

Note the `Artisan::queue`, the command will be executed in background and will not block the current request.

Stats command
-------------

[](#stats-command-1)

The command `slack:stats` send useful stats about your app to slack.

You need to configure this command by setting in `config/slack-output.php` the Eloquent classes and dates you prefer.

You can add constraints to the classes to limit the number of counted data.

```
'classes' => [
	  \App\Models\User::class => [
		  'is_active' => true //optional constraint
	  ]
],
```

The dates array is the form `'name of the date' => Carbon::instance()`. Like:

```
'dates' => [
	'yesterday' => \Carbon\Carbon::yesterday(),
	'last week' => \Carbon\Carbon::today()->subWeek(1)
]
```

To schedule this command every day, simple add to `app/Console/Kernel.php`:

```
protected function schedule(Schedule $schedule)
{
  $schedule->command('slack:stats')->daily()
}
```

Exceptions handler
------------------

[](#exceptions-handler-1)

To report useful exception to Slack, open `app/Exceptions/Handler.php`, and transform it like:

```
use SyedAunn\SlackOutput\Facade\SlackOutput;

...

public function report(Exception $e)
{
  if ($this->shouldReport($e)) {
    SlackOutput::exception($e);
  }

  parent::report($e);
}
```

This will only reports exceptions that are not in the `$dontReport` array in the same file.

Failed jobs handler
-------------------

[](#failed-jobs-handler-1)

To report failed jobs to Slack, open `app/Providers/AppServiceProvider.php`, and transform it like:

```
use SyedAunn\SlackOutput\Facade\SlackOutput;

...

public function boot()
{
  Queue::failing(function (JobFailed $job) {
    SlackOutput::jobFailed($job);
  });
}
```

Scheduled commands reporting
----------------------------

[](#scheduled-commands-reporting-1)

To report the output of scheduled commands to Slack, open `app/Console/Kernel.php`, and transform it like:

```
use SyedAunn\SlackOutput\Facade\SlackOutput;

...

protected function schedule(Schedule $schedule)
{
  SlackOutput::scheduledCommand(
    $schedule->command('db:backup-auto')->daily()
  );
}
```

Contributing
============

[](#contributing)

If you have problems, found a bug or have a feature suggestion, please add an issue on GitHub. Pull requests are also welcomed!

License
=======

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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

Every ~114 days

Recently: every ~224 days

Total

9

Last Release

2850d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9560361bb779d4747ea0ae4b554176bb0873f2355b11dbed0e255a4a9fdce31b?d=identicon)[syedaunn](/maintainers/syedaunn)

---

Top Contributors

[![NicolasMahe](https://avatars.githubusercontent.com/u/5823445?v=4)](https://github.com/NicolasMahe "NicolasMahe (30 commits)")[![jcalonso](https://avatars.githubusercontent.com/u/664474?v=4)](https://github.com/jcalonso "jcalonso (3 commits)")[![syedaunn](https://avatars.githubusercontent.com/u/7701748?v=4)](https://github.com/syedaunn "syedaunn (3 commits)")[![gerciljunio](https://avatars.githubusercontent.com/u/4561073?v=4)](https://github.com/gerciljunio "gerciljunio (1 commits)")[![kurorido](https://avatars.githubusercontent.com/u/300858?v=4)](https://github.com/kurorido "kurorido (1 commits)")[![yukato](https://avatars.githubusercontent.com/u/4372249?v=4)](https://github.com/yukato "yukato (1 commits)")

---

Tags

laravelexceptionslackcommandjobs

### Embed Badge

![Health badge](/badges/syedaunn-laravel-slack-output/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[nicolasmahe/laravel-slack-output

Sends a message to Slack when something goes wrong with your Laravel application.

2942.9k](/packages/nicolasmahe-laravel-slack-output)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2332.0M2](/packages/inspector-apm-inspector-laravel)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8674.9k](/packages/illuminated-console-logger)

PHPackages © 2026

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