Coder Social home page Coder Social logo

trello-channel's Introduction

Trello notifications channel for Laravel

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to create Trello cards with Laravel 6.x, 7.x, 8.x & 9.x.

Contents

Installation

You can install the package via composer:

composer require laravel-notification-channels/trello

Setting up the Trello service

Add your Trello REST API Key to your config/services.php:

// config/services.php
...
'trello' => [
    'key' => env('TRELLO_API_KEY'),
],
...

Usage

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',
    ];
}

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 for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

trello-channel's People

Contributors

superdejooo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.