Skip to content

nikaia/laravel-notifications-pivotaltracker

Repository files navigation

Use this repo as a skeleton for your new channel, once you're done please submit a Pull Request on this repo with all the files.

Here's the latest documentation on Laravel 5.3 Notifications System:

https://laravel.com/docs/master/notifications

A Boilerplate repo for contributions

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

This package makes it easy to create stories using PivotalTracker with Laravel 5.3

Contents

Installation

You can install the package via composer:

composer require laravel-notification-channels/pivotaltracker

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\PivotalTracker\PivotalTrackerChannel;
use NotificationChannels\PivotalTracker\PivotalTrackerMessage;
use Illuminate\Notifications\Notification;

class AnApplicationEvent extends Notification
{
    public function via($notifiable)
    {
        return [PivotalTrackerChannel::class];
    }

    public function toPivotalTracker($notifiable)
    {
       return (new PivotalTrackerMessage('Something just occurred!'))
                   ->description('This is a test for a notification via Pivotal Tracker.')
                   ->type('bug')
                   ->labels(['a_chore', 'just_a_test']);
    }
}

In order to let your Notification know which PivotalTracker user and project you are targeting, add the routeNotificationForPivotalTracker method to your Notifiable model.

This method needs to return an array containing the access token of the authorized Pivotal Tracker user and the project ID to add the story to.

public function routeNotificationForPivotalTracker()
{
    return [
        'token' => 'NotifiableToken',
        'projectId' => 'ThePivotalTrackerProjectID'
    ];
}

Available methods

  • name(''): Accepts a string value for the story name.
  • description(''): Accepts a string value for the story description.
  • type(''): Accepts a string value for the story type (feature|bug|chore)
  • labels([]): Accepts an array of strings representing the story labels.
    • Alternatively you can pass the labels as arguments.

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.

About

Pivotal Tracker Laravel Notifications driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages