2017 © Pedro Peláez
 

library laravel-slack-api

Wrapper for Slack.com WEB API. Based on code from Vagner do Carmo.

image

wgmv/laravel-slack-api

Wrapper for Slack.com WEB API. Based on code from Vagner do Carmo.

  • Sunday, February 11, 2018
  • by wgmv
  • Repository
  • 1 Watchers
  • 1 Stars
  • 414 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 25 Versions
  • 204 % Grown

The README.md

Laravel 5 and Lumen - Slack API

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

StyleCI, (*2)

This package provides a simple way to use the Slack API., (*3)

The package is a fork from https://github.com/Vluzrmos/laravel-slack-api The original package is not maintained and I made several changes that possibly make this version incompatible to the original., (*4)

Changes made:

  • removed functionality to lookup user by nickname: this package provides basic functionality
  • removed cache as it was not needed anymore
  • added basic tests
  • updated slack api options on a couple of methods
  • fixed minor bugs

Installation

composer require wgmv/laravel-slack-api, (*5)

Installation on Laravel 5

The package has autodiscovery enabled. (A laravel 5.5 feature), (*6)

[
    'providers' => [
        Wgmv\SlackApi\SlackApiServiceProvider::class,
    ]
]

Configuration

This package uses slacks legacy tokens. Get you token here:, (*7)

https://api.slack.com/custom-integrations/legacy-tokens, (*8)

Configure your slack team token in config/services.php, (*9)


[ //..., 'slack' => [ 'token' => 'your token here' ] ]

Installation on Lumen

I have not tested the lumen installation! Documentation from the original package:, (*10)

Add the following line on bootstrap/app.php:, (*11)

// $app->register('App\Providers\AppServiceProvider'); (by default that comes commented)
$app->register('Wgmv\SlackApi\SlackApiServiceProvider');

If you want to use facades, add this lines on bootstrap/app.php, (*12)

class_alias('Wgmv\SlackApi\Facades\SlackApi', 'SlackApi');
//... and others

Otherwise, just use the singleton shortcuts:, (*13)

/** @var \Wgmv\SlackApi\Contracts\SlackApi $slackapi */
$slackapi     = app('slack.api');

/** @var \Wgmv\SlackApi\Contracts\SlackChannel $slackchannel */
$slackchannel = app('slack.channel');

etc

Example Usage

//Lists all users on your team
SlackUser::lists(); 

//Lists all channels on your team
SlackChannel::lists(); 

//List all groups
SlackGroup::lists();

//Invite a new member to your team
SlackUserAdmin::invite("example@example.com", [
    'first_name' => 'John', 
    'last_name' => 'Doe'
]);

// or just use the helper

//Autoload the api
slack()->post('chat.postMessage', [...]);

//Autoload a Slack Method
slack('Chat')->message([...]);
slack('Team')->info();

All Injectable Contracts:

Generic API

Wgmv\SlackApi\Contracts\SlackApi, (*14)

Allows you to do generic requests to the api with the following http verbs: get, post, put, patch, delete ... all allowed api methods you could see here: Slack Web API Methods., (*15)

Channels API

Wgmv\SlackApi\Contracts\SlackChannel, (*16)

Allows you to operate channels: invite, archive, rename, join, kick, setPurpose ..., (*17)

Chat API

Wgmv\SlackApi\Contracts\SlackChat, (*18)

Allows you to send, update and delete messages with methods: delete, message, update., (*19)

Files API

Wgmv\SlackApi\Contracts\SlackFile, (*20)

Allows you to send, get info, delete, or just list files: info, lists, upload, delete., (*21)

Groups API

Wgmv\SlackApi\Contracts\SlackGroup, (*22)

Same methods of the SlackChannel, but that operates with groups and have adicional methods: open, close, createChild, (*23)

Instant Messages API (Direct Messages)

Wgmv\SlackApi\Contracts\SlackInstantMessage, (*24)

Allows you to manage direct messages to your team members., (*25)

Real Time Messages API

Wgmv\SlackApi\Contracts\SlackRealTimeMessage, (*26)

Allows you list all channels and user presence at the moment., (*27)

Search API

Wgmv\SlackApi\Contracts\SlackSearch, (*28)

Find messages or files., (*29)

Stars API

Wgmv\SlackApi\Contracts\SlackStar, (*30)

List all of starred itens., (*31)

Team API

Wgmv\SlackApi\Contracts\SlackTeam, (*32)

Get information about your team., (*33)

Users API

Wgmv\SlackApi\Contracts\SlackUser, (*34)

Get information about an user on your team or just check your presence ou status., (*35)

Users Admin API

Wgmv\SlackApi\Contracts\SlackUserAdmin, (*36)

Invite new members to your team., (*37)

License

DBAD License., (*38)

The Versions

11/02 2018

dev-master

9999999-dev

Wrapper for Slack.com WEB API. Based on code from Vagner do Carmo.

  Sources   Download

MIT dbad

The Requires

 

The Development Requires

by Walter Vogel

laravel lumen slack

19/09 2017

v0.5.0

0.5.0.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

The Development Requires

by Walter Vogel

laravel lumen slack

22/10 2016

v0.4.8

0.4.8.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

05/06 2016

v0.4.7

0.4.7.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

06/02 2016

v0.4.6

0.4.6.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

31/12 2015

v0.4.5

0.4.5.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

27/06 2015

v0.4.4

0.4.4.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

26/06 2015

v0.4.3

0.4.3.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

26/06 2015

v0.4.2

0.4.2.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

16/06 2015

v0.4.1

0.4.1.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

16/06 2015

v0.4.0

0.4.0.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

16/06 2015

v0.3.1

0.3.1.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

16/06 2015

v0.3.0

0.3.0.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

30/05 2015

v0.2.0

0.2.0.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

21/05 2015

v0.1.0

0.1.0.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

02/05 2015

v0.0.10

0.0.10.0

Wrapper for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel lumen slack

02/05 2015

v0.0.9

0.0.9.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

22/03 2015

v0.0.8

0.0.8.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

22/03 2015

v0.0.7

0.0.7.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

25/02 2015

v0.0.6

0.0.6.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

24/02 2015

v0.0.5

0.0.5.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

23/02 2015

v0.0.4

0.0.4.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

23/02 2015

v0.0.3

0.0.3.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

23/02 2015

v0.0.2

0.0.2.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack

23/02 2015

v0.0.1

0.0.1.0

Class for Slack.com WEB API.

  Sources   Download

dbad

The Requires

 

laravel api slack