Package Data | |
---|---|
Maintainer Username: | laravel-notification-channels |
Maintainer Contact: | m.pociot@gmail.com (Marcel Pociot) |
Package Create Date: | 2016-08-14 |
Package Last Update: | 2022-02-05 |
Home Page: | https://laravel-notification-channels.com |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-29 15:11:12 |
Package Statistics | |
---|---|
Total Downloads: | 3,777 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 25 |
Total Watchers: | 5 |
Total Forks: | 12 |
Total Open Issues: | 2 |
This package makes it easy to create Trello cards with Laravel 5.3+.
You can install the package via composer:
composer require laravel-notification-channels/trello
Add your Trello REST API Key to your config/services.php
:
// config/services.php
...
'trello' => [
'key' => env('TRELLO_API_KEY'),
],
...
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\Trello\TrelloChannel;
use NotificationChannels\Trello\TrelloMessage;
use Illuminate\Notifications\Notification;
class ProjectCreated extends Notification
{
public function via($notifiable)
{
return [TrelloChannel::class];
}
public function toTrello($notifiable)
{
return TrelloMessage::create()
->name("Trello Card Name")
->description("This is the Trello card description")
->top()
->due('tomorrow');
}
}
In order to let your Notification know which Trello user and Trello list you are targeting, add the routeNotificationForTrello
method to your Notifiable model.
This method needs to return an array containing the access token of the authorized Trello user (if it's a private board) and the list ID of the Trello list to add the card to.
public function routeNotificationForTrello()
{
return [
'token' => 'NotifiableToken',
'idList' => 'TrelloListId',
];
}
name('')
: Accepts a string value for the Trello card name.description('')
: Accepts a string value for the Trello card description.top()
: Moves the Trello card to the top.bottom()
: Moves the Trello card to the bottom.position('')
: Accepts an integer for a specific Trello card position.due('')
: Accepts a string or DateTime object for the Trello card due date.Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email m.pociot@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.