Package Data | |
---|---|
Maintainer Username: | gahlawat |
Maintainer Contact: | jiveshsg@gmail.com (Jivesh Gahlawat) |
Package Create Date: | 2015-08-01 |
Package Last Update: | 2018-06-30 |
Home Page: | https://gahlawat.github.io/laravel-slack |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:13:46 |
Package Statistics | |
---|---|
Total Downloads: | 36,578 |
Monthly Downloads: | 21 |
Daily Downloads: | 1 |
Total Stars: | 25 |
Total Watchers: | 3 |
Total Forks: | 7 |
Total Open Issues: | 1 |
A very tiny and lightweight integration with the Slack API for posting notifications or any kind of messages to your team's Slack account.
Using Composer package manager, install this package by running following command in your project root:
$ composer require jivesh/laravel-slack
This package supports auto discovery feature introduced in Laravel v5.5, hence it is auto registered. You may skip to 'Configuration' section below.
If your app is on Laravel v5.4 or below, follow below steps to register:
In your config/app.php
file, append the following code into your providers
array for integrating the Service Provider for package.
/**
* Package Service Provider
*/
'providers' => [
// ...
Gahlawat\Slack\SlackServiceProvider::class,
],
config/app.php
file, copy the following code into your aliases
array for a nice Laravel syntax using Facades./**
* Package Alias
*/
'aliases' => [
// ...
'Slack' => Gahlawat\Slack\Facade\Slack::class,
],
Create an incoming webhook on your Slack account for the package to use and copy the generated Webhook URL.
Run the following command in project root directory to generate config file for package.
$ php artisan vendor:publish
config/slack.php
and paste value for incoming-webhook
generated in the first step above.\Slack::send("your-message");
using
it:use Slack;
\
as:Slack::send("your-message");
Slack::send("your-message" [,"display-name" [,"display-emoji"] [,"#channel" or "@username"]]);
// here [] indicates optional parameters
See this cheat sheet of available emoji icons.