Package Data | |
---|---|
Maintainer Username: | laravel-notification-channels |
Maintainer Contact: | jhaoda@gmail.com (JhaoDa) |
Package Create Date: | 2016-08-16 |
Package Last Update: | 2020-09-12 |
Home Page: | http://laravel-notification-channels.com |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-19 03:02:40 |
Package Statistics | |
---|---|
Total Downloads: | 190 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 10 |
Total Watchers: | 5 |
Total Forks: | 3 |
Total Open Issues: | 0 |
This package makes it easy to send notifications using Gitter.im with Laravel 5.3.
You can install the package via composer:
composer require laravel-notification-channels/gitter
In order to send message to Gitter rooms, you need to obtain Personal Access Token or application token.
You can use the channel in your via()
method inside the notification:
use Illuminate\Notifications\Notification;
use NotificationChannels\Gitter\GitterMessage;
use NotificationChannels\Gitter\GitterChannel;
class TaskCompleted extends Notification
{
public function via($notifiable)
{
return [GitterChannel::class];
}
public function toGitter($notifiable)
{
return GitterMessage::create("Task #{$notifiable->id} is complete!")
->room('room_id') // optional
->from('user_or_app_access_token');
}
}
In order to let your notification know which Gitter room you are targeting, add the routeNotificationForGitter
method to your Notifiable model:
public function routeNotificationForGitter()
{
return 'room_id';
}
from()
: Sets the sender's access token.
room()
: Specifies the room id to send the notification to (overridden by routeNotificationForGitter
if empty).
content()
: Sets a content of the notification message. Supports Github flavoured markdown.
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email jhaoda@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.