This is the Laravel 5 Bridge for NotifyMe.
Either PHP 5.5+ or HHVM 3.6+ are required.
To get the latest version of NotifyMe Laravel, simply require the project using Composer:
$ composer require notifymehq/laravel
Instead, you may of course manually update your require block and run composer update
if you so choose:
{
"require": {
"notifymehq/laravel": "^1.0"
}
}
Note that installing that package only pulls in the bare minimum and will not give you any adapters. You may require the adapters indiviually, or, require the whole deal (notifymehq/notifyme
).
Add the service provider to app.php
'providers' => [
// ...
'NotifyMeHQ\Laravel\NotifyMeServiceProvider',
],
If you want to use the Facade, also add the alias:
'aliases' => [
// ...
'NotifyMe' => 'NotifyMeHQ\Laravel\Facades\NotifyMe',
],
Install the configuration file.
$ php artisan config:publish
Configure your connections.
return [
'default' => 'slack',
'connections' => [
'slack' => [
'driver' => 'slack',
'from' => 'notifyme',
'token' => 'your-token',
],
'webhook' => [
'driver' => 'webhook',
],
],
];
$response = NotifyMe::notify('#tests', 'This is working awesome!');
echo $response->isSent() ? 'Message sent' : 'Message going nowhere';
$response = NotifyMe::connection('slack')->notify('#tests', 'This is working awesome!');
echo $response->isSent() ? 'Message sent' : 'Message going nowhere';
For more information about the usage go to NotifyMe.
NotifyMe is licensed under The MIT License (MIT).