2017 © Pedro Peláez
 

package laravel-slack

A minimalist laravel integration for Slack

image

jivesh/laravel-slack

A minimalist laravel integration for Slack

  • Saturday, June 30, 2018
  • by jivesh
  • Repository
  • 2 Watchers
  • 21 Stars
  • 8,055 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 12 Versions
  • 19 % Grown

The README.md

laravel-slack

Author Travis Quality Score Code Climate Total Downloads Packagist Version Software License SensioLabsInsight, (*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., (*2)


Requirements

  • Laravel Framework 5+

Installation

Using Composer package manager, install this package by running following command in your project root:, (*3)

$ composer require jivesh/laravel-slack

Registering the Package

  • This package supports auto discovery feature introduced in Laravel v5.5, hence it is auto registered. You may skip to 'Configuration' section below., (*4)

  • If your app is on Laravel v5.4 or below, follow below steps to register:, (*5)

    • 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,
],
  • Again in your 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,
],

Configuration

  • Create an incoming webhook on your Slack account for the package to use and copy the generated Webhook URL., (*6)

  • Run the following command in project root directory to generate config file for package., (*7)

$ php artisan vendor:publish
  • Now edit config/slack.php and paste value for incoming-webhook generated in the first step above.
  • You may optionally set a default username and emoji icon displayed in your Slack app from here.

Usage

  • Send any message in real time to your Slack account using this anywhere in your php code:
\Slack::send("your-message");
  • The backslash indicates global namespace scope for this function, you may import Slack namespace on top of your file by using it:
use Slack;
  • Then, you can call this Facade without a \ as:
Slack::send("your-message");
  • You can change the default name and/or display icon in your Slack app for any message by using optional second and third parameter.
  • To send this message privately to any user, use the fourth parameter as @username
  • To send this message publicly to any channel, use the fourth parameter as #channel
Slack::send("your-message" [,"display-name" [,"display-emoji"] [,"#channel" or "@username"]]);

// here [] indicates optional parameters

See this cheat sheet of available emoji icons., (*8)

The Versions

30/06 2018

dev-development

dev-development https://gahlawat.github.io/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jivesh Gahlawat

laravel slack

04/04 2018

dev-master

9999999-dev https://gahlawat.github.io/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jivesh S. Gahlawat
by Jivesh Gahlawat

laravel slack

04/04 2018

2.1.2

2.1.2.0 https://gahlawat.github.io/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jivesh Gahlawat

laravel slack

30/03 2018

2.1.1

2.1.1.0 http://github.com/gahlawat/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jivesh Gahlawat

laravel slack

30/03 2018

2.1

2.1.0.0 http://github.com/gahlawat/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jivesh Gahlawat

laravel slack

30/08 2017

2.0.0

2.0.0.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

13/09 2016

dev-dev

dev-dev http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

13/12 2015

1.0.3

1.0.3.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

08/08 2015

1.0.2

1.0.2.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

02/08 2015

1.0.1

1.0.1.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

02/08 2015

1.0.0

1.0.0.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack

01/08 2015

0.0.1

0.0.1.0 http://github.com/jiveshsg/laravel-slack

A minimalist laravel integration for Slack

  Sources   Download

MIT

The Requires

 

by Jivesh S. Gahlawat

laravel slack