Package Data | |
---|---|
Maintainer Username: | seleznev |
Maintainer Contact: | seleznevdev@gmail.com (Oleg Seleznev) |
Package Create Date: | 2016-01-31 |
Package Last Update: | 2016-02-14 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-17 03:01:02 |
Package Statistics | |
---|---|
Total Downloads: | 9,512 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Beep is a lightweight Laravel package for sending notifications to your team via Slack and HipChat. Inspiration and the initial code was taken from Laravel Envoy.
Require the seleznev/beep
package using Composer:
composer require seleznev/beep
Add the service provider in config/app.php
to providers
array:
Seleznev\Beep\ServiceProvider::class,
Add the alias in config/app.php
to aliases
array:
'Beep' => Seleznev\Beep\Facade::class,
For the Laravel 5.0.* you should add 'Seleznev\Beep\ServiceProvider',
and 'Beep' => 'Seleznev\Beep\Facade',
respectively.
To get started, you'll need to create a Slack token or a HipChat token.
Add your SLACK_TOKEN
and HIPCHAT_TOKEN
to the .env
file.
Send a message to a Slack channel:
Beep::slack('#channel')->say('Hi');
Send a message to a HipChat room:
Beep::hipchat('room')->say('Hi');
Send a message from a chosen name:
Beep::slack('#channel')->from('My application')->say('Hi');
A few attractive examples:
public function report(Exception $e)
{
parent::report($e);
$message = App::environment().': '.$e->getMessage();
Beep::slack('#logs')->say($message);
}
Post::created(function ($post) {
$message = "*{$post->user->name}* has created _{$post->title}_ post!";
Beep::slack('#activity')->say($message);
});
Post::created(function ($post) {
$message = "<b>{$post->user->name}</b> has created <i>{$post->title}</i> post!";
Beep::hipchat('activity')->say($message);
});
Add the service provider in bootstrap/app.php
to Register Service Providers
block:
$app->register(Seleznev\Beep\ServiceProvider::class);
app('beep')->slack('#channel')->say('Lumen');
Beep is licensed under The MIT License (MIT).