Skip to content

Maras0830/laravel-log-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Log to Slack Channel

via incoming callback - https://api.slack.com/incoming-webhooks

2018-09-03 5 22 26

Installation

$ composer require maras0830/laravel-LogSlack

in config/app.php

    'providers' => [
    	...
        Maras0830\LogSlack\Providers\LogSlackBotServiceProvider::class,
    ];		

.env

SLACK_LOG_LEVEL=success,warning,error
SLACK_LOG_CALLBACK_URL=<slack_incoming_callback_url>

if your laravel version >= 5.8, install laravel/slack-notification-channel

$ composer require laravel/slack-notification-channel

Example

in route/web.php

Route::get('slack', function() {

    Log::debug('Slack Log ', ['Slack' => 'Hello']);
});

call http://localhost/slack

2018-09-03 5 23 16