https://github.com/laravel-notification-channels/trello
Trello notifications channel for Laravel
https://github.com/laravel-notification-channels/trello
Last synced: 2 months ago
JSON representation
Trello notifications channel for Laravel
- Host: GitHub
- URL: https://github.com/laravel-notification-channels/trello
- Owner: laravel-notification-channels
- License: mit
- Created: 2016-08-14T18:25:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-02-05T09:42:44.000Z (over 3 years ago)
- Last Synced: 2025-03-29T03:32:14.661Z (3 months ago)
- Language: PHP
- Homepage: https://laravel-notification-channels.com
- Size: 22.5 KB
- Stars: 25
- Watchers: 4
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Trello notifications channel for Laravel
[](https://packagist.org/packages/laravel-notification-channels/trello)
[](LICENSE.md)
[](https://travis-ci.org/laravel-notification-channels/trello)
[](https://styleci.io/repos/65379321)
[](https://insight.sensiolabs.com/projects/9015691f-130d-4fca-8710-72a010abc684)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/trello)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/trello/?branch=master)
[](https://packagist.org/packages/laravel-notification-channels/trello)This package makes it easy to create [Trello cards](https://developers.trello.com/) with Laravel 6.x, 7.x & 8.x.
## Contents
- [Installation](#installation)
- [Setting up the Trello service](#setting-up-the-trello-service)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)## Installation
You can install the package via composer:
``` bash
composer require laravel-notification-channels/trello
```### Setting up the Trello service
Add your Trello REST API Key to your `config/services.php`:
```php
// config/services.php
...
'trello' => [
'key' => env('TRELLO_API_KEY'),
],
...
```## Usage
Now you can use the channel in your `via()` method inside the notification:
``` php
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.
```php
public function routeNotificationForTrello()
{
return [
'token' => 'NotifiableToken',
'idList' => 'TrelloListId',
];
}
```### Available methods
- `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.## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.