This package makes it easy to send notifications using Asana with Laravel 5.6.
You can install the package via composer:
composer require laravel-notification-channels/asana
Once installed you need to register the service provider with the application. Open up config/app.php
and find the providers
key.
'providers' => [
\Torann\LaravelAsana\ServiceProvider::class,
]
Run this on the command line from the root of your project:
$ php artisan vendor:publish --provider="Torann\LaravelAsana\ServiceProvider" --tag=config
A configuration file will be publish to config/asana.php
.
Add your Asana Token to .env
ASANA_TOKEN=xxx
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\Asana\AsanaChannel;
use NotificationChannels\Asana\AsanaMessage;
use Illuminate\Notifications\Notification;
class TestNotification extends Notification
{
public function via($notifiable)
{
return [AsanaChannel::class];
}
public function toAsana($notifiable)
{
return AsanaMessage::create("Test Task")
->notes("Description of task ...")
->assignee("john.doe@test.com")
->dueOn(new \DateTime());
}
}
name('')
: Accepts a string value for the Asana task title.notes('')
: Accepts a string value for the Asana task notes (default: '').assignee('')
: Accepts either email address of an asana user or user id.workspace('')
: Accepts a string value for the Asana workspace (default: config.asana.workspaceId).projects('')
: Accepts a string value for a single Asana project or an array of project ids (default: config.asana.projectId).dueOn('')
: Accepts a string or DateTime object for the Asana task due date.
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email mauthi@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.