2017 © Pedro Peláez
 

library laravel-slack

Laravel package for sending slack messages

image

nimbles-nl/laravel-slack

Laravel package for sending slack messages

  • Friday, January 12, 2018
  • by nimbles-nl
  • Repository
  • 0 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Build Status Latest Stable Version License Total Downloads codecov Scrutinizer Code Quality, (*1)

Laravel Slack Package

A laravel package for sending Slack messages, (*2)

For more information see Slack, (*3)

Requirements

Laravel 5.1 or later, (*4)

Installation

Installation is a quick 3 step process:, (*5)

  1. Download laravel-slack using composer
  2. Configure your HTTP Adapter
  3. Enable the package in app.php
  4. Configure your Slack credentials
  5. (Optional) Configure the package facade

Step 1: Download laravel-slack using composer

Add nimbles-nl/laravel-slack by running the command:, (*6)

composer require nimbles-nl/laravel-slack

Step 2: Configure you HTTP Adapter in your service container

Configure the http adapter in your AppServiceProvider.php, (*7)

``` php use GuzzleHttp\Client as GuzzleClient; use Http\Adapter\Guzzle6\Client as GuzzleAdapter;, (*8)

$this->app->singleton('http.client', function() { return new GuzzleAdapter(new GuzzleClient()); });, (*9)


### Step 3: Enable the package in app.php Register the Service in: **config/app.php** ``` php Nimbles\Slack\SlackServiceProvider::class, ```` ### Step 4: Configure Slack credentials

php artisan vendor:publish, (*10)


Add this in you **.env** file

SLACK_ACCESS_TOKEN=your_secret_slack_access_token ```, (*11)

Step 5 (Optional): Configure the package facade

Register the Slack Facade in: config/app.php, (*12)

``` php 'aliases' => [, (*13)

    'App' => Illuminate\Support\Facades\App::class,
    'Artisan' => Illuminate\Support\Facades\Artisan::class,
    'Auth' => Illuminate\Support\Facades\Auth::class,
    ...
    'Slack' => Nimbles\Slack\Facade\Slack::class,

Usage ----- ``` php $slackMessage = new SlackMessage('You re looking great today!', '#general', 'AwesomeBot', 'https://www.link-to-avatar.com/image.png'); app('slack')->sendMessage($slackMessage);

Or if you want to use facade, add this in your class after namespace declaration:, (*14)

``` php Slack::sendMessage(new SlackMessage('You are looking great today!')); ````, (*15)

The Versions

12/01 2018

dev-master

9999999-dev https://github.com/nimbles-nl/laravel-slack

Laravel package for sending slack messages

  Sources   Download

MIT

The Requires

 

The Development Requires

by Wessel Strengholt

laravel package slack

12/01 2018

v1.0.0

1.0.0.0 https://github.com/nimbles-nl/laravel-slack

Laravel package for sending slack messages

  Sources   Download

MIT

The Requires

 

The Development Requires

by Wessel Strengholt

laravel package slack