joeri-abbo/laravel-slack is a Laravel package for laravel slack package.
It currently has 0 GitHub stars and 214 downloads on Packagist.
Install it with composer require joeri-abbo/laravel-slack.
Discover more Laravel packages by joeri-abbo
or browse all Laravel packages to compare alternatives.
Last updated
To get started require the package with composer.
composer require joeri-abbo/laravel-slack
Publish the package for laravel
php artisan vandor:publish --provider="JoeriAbbo\LaravelSlack\LaravelSlackServiceProvider"
Now go to your config folder and edit the slack.php file. Add your channel id and channel name like below
<?php
return [
'bearer_token' => env('SLACK_BEARER_TOKEN'),
'channels' => [
'my-new-log-channel' => '#ID-of-slack-channel',
]
];
Now add the JoeriAbbo\Slack\SlackPackageServiceProvider:class to your providers array in config/app.php
And add your bearer token to your .env file with SLACK_BEARER_TOKEN
Now you can easily use the slack for logging or notifications. To notify the channel use the following function.
app('slack.log')->sendMessage('This is a test message')
version 1.0.0