This package provides slack support for laravel. It is similar to Slack Laravel but instead of using the deprecated library Slack for PHP 1, it uses Slack for PHP 2. A new developer is leading the project in a different repository.
- Note 2020: Support for Laravel 6
Require this package using the git repository. I have not published it into packagist.
"require": {
...
"javfres/slack-laravel": "^3.0.0",
},
...
"repositories": [
{
"type": "git",
"url": "https://github.com/javfres/laravel-jslang"
}
]
Then create an incoming webhook for each the Slack team you'd like to send messages to.
Add the Javfres\Slack\ServiceProvider
provider to the providers
array in config/app.php
:
'providers' => [
Javfres\Slack\ServiceProvider::class,
],
Then add the facade to your aliases
array:
'aliases' => [
...
'Slack' => Javfres\Slack\Facades\Slack::class,
],
Finally, publish the config file with php artisan vendor:publish
. You will find it at config/slack.php
.
The config file comes with defaults and placeholders. Configure at least one team and any defaults you'd like to change.
Config for using this directly from a folder instead from github for debug.
"require": {
...
"javfres/slack-laravel": "@dev",
},
...
"repositories": [
{
"type": "path",
"url": ".../0_repos/slack-laravel"
}
]