LFelin / laravel-tracetoslack by LFelin

Send your traceback on a channel of slack
32
0
1
Package Data
Maintainer Username: LFelin
Maintainer Contact: felin.ludovic@gmail.com (Ludovic Felin)
Package Create Date: 2016-07-01
Package Last Update: 2016-07-14
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-23 03:20:15
Package Statistics
Total Downloads: 32
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Laravel Trace to Slack

License Latest Stable Version Total Downloads


For Laravel 4.2, use the 4.2 branch


About

Trace to slack is a simple package for laravel to notify the errors of your application in slack https://slack.com/

Installation

Pull this package in through Composer.


    {
        "require": {
            "lfelin/laravel-tracetoslack": "1.*"
        }
    }

Dump your autoload

composer dump-autoload -o

Laravel 5.* Integration

Add the service provider to your config/app.php file:


    'providers'     => array(

        //...
        Lfelin\TraceToSlack\TraceToSlackServiceProvider::class,

    ),

In your app/Exceptions/Handler.php file:

Replace

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

by

use Lfelin\TraceToSlack\Handler as ExceptionHandler;

Configuration

Publish configuration

php artisan vendor:publish

In your config/tracetoslack.php file configure the parameters. The parameter webhook_url is required :


    return array(

        /*
         |--------------------------------------------------------------------------
         | Notify on debug
         |--------------------------------------------------------------------------
         | Default: false
         | The notifications are also sent if the debug mode is activated [true]
         |
         */

        'active_on_debug' => false,

        /*
         |--------------------------------------------------------------------------
         | Your private Webhook URL
         |--------------------------------------------------------------------------
         | [Required]
         | Eg: https://hooks.slack.com/services/XXX/XXX
         |
         */

        'webhook_url' => 'https://hooks.slack.com/services/XXX/XXX',

        /*
         |--------------------------------------------------------------------------
         | Username
         |--------------------------------------------------------------------------
         | [Optional]
         | Default: John Bot
         |
         */

        'username' => '',

        /*
         |--------------------------------------------------------------------------
         | Emoji
         |--------------------------------------------------------------------------
         | [Optional]
         | Default: ':warning:'
         | http://www.emoji-cheat-sheet.com/ for example
         |
         */

        'icon_emoji' => '', //  default: ':bug:' => http://www.emoji-cheat-sheet.com/

        /*
         |--------------------------------------------------------------------------
         | Emoji Url
         |--------------------------------------------------------------------------
         | [Optional]
         | This param increase icon_emoji
         | https://slack.com/img/icons/app-57.png for example
         |
         */

        'icon_url' => '',

        /*
         |--------------------------------------------------------------------------
         | Other Channel
         |--------------------------------------------------------------------------
         | [Optional]
         | Default: The default channel is the one set in the web Hook
         | This name start by '#' or '@' for Direct Message
         | Eg: #general - @username
         |
         */

        'other_channel' => '',
    );

Create Incoming WebHooks

Create a new webhook : https://my.slack.com/services/new/incoming-webhook/

Documentation : https://api.slack.com/custom-integrations

Example on slack

example

Suggestions and issues

Use github issues to suggest improvements or reassembling your problems