via incoming callback - https://api.slack.com/incoming-webhooks
$ 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
in route/web.php
Route::get('slack', function() {
Log::debug('Slack Log ', ['Slack' => 'Hello']);
});
call http://localhost/slack