From the command line run:
$ composer require torann/laravel-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,
]
For Lumen register the service provider in bootstrap/app.php
.
$app->register(\Torann\LaravelAsana\ServiceProvider::class);
This package also ships with a facade which provides the static syntax for creating collections. You can register the facade in the aliases key of your config/app.php
file.
'aliases' => [
'Asana' => 'Torann\LaravelAsana\Facade',
]
Run this on the command line from the root of your project:
$ php artisan vendor:publish --provider="Torann\LaravelAsana\ServiceProvider"
A configuration file will be publish to config/asana.php
.
Asana::getUserInfo($user_id);
Will return the user's info of the owner of the Personal Access Token.
Asana::getCurrentUser();
Will return the user's info of the owner of the Personal Access Token.
Asana::getUsers();
Asana::getTask($task_id);
Asana::getSubTasks($task_id);
Asana::createTask([
'workspace' => '176825', // Workspace ID
'name' => 'Hello World!', // Name of task
'assignee' => 'foo@bar.com', // Assign task to...
'followers' => ['3714136', '5900783'] // We add some followers to the task... (this time by ID)
]);
Asana::deleteTask($task_id);
Asana::addProjectToTask($task_id, $project_id);
Asana::removeProjectToTask($task_id, $project_id);
Asana::getTaskStories($task_id);
Asana::commentOnTask($task_id, "Please please! Don't assign me this task!");
Asana::addTagToTask($task_id, $tag_id);
Asana::removeTagFromTask($task_id, $tag_id);
Asana::createProject([
"workspace" => "1768",
"name" => "Foo Project!",
"notes" => "This is a test project"
]);
Asana::getProjects();
$archived = false;
Asana::getProjectsInWorkspace($workspace_id, $archived);
Asana::updateProject($project_id, [
'name' => 'This is a new cool project!',
'notes' => 'At first, it wasn't cool, but after this name change, it is!'
]);
Asana::getProjectTasks($project_id);
Asana::getProjectStories($project_id);
Asana::getSingleStory($story_id);
$text = "Such fun!";
Asana::commentOnProject($project_id, $text)
Asana::getTag($tag_id);
Asana::getTags();
// $data - array - An array containing fields to update, see Asana API if needed.
Asana::updateTag($tag_id, $data);
Asana::getTasksWithTag($tag_id);
Asana::getWorkspaces();
$data = ['name' => ''];
Asana::updateWorkspace($workspace_i, $data);
// Assignee can either be 'me' or a user's ID
Asana::getWorkspaceTasks($workspace_id, $assignee);
Asana::getWorkspaceTags($workspace_id);
Asana::getWorkspaceUsers($workspace_id);
If you specify an assignee, you must also specify a workspace to filter on.
Asana::getTasksByFilter([
'assignee' => 1121,
'project' => 37373729,
'workspace' => 111221
]);
Asana stopped supporting API keys, so now we must use a Personal Access Token. See Asana's directions for generating a personal access tokens. Then update the config/asana.php
config file with the new token:
'accessToken' => env('ASANA_TOKEN'),
- Remove API key (deprecated) support
- Add support for Lumen
- Code cleanup
- Update to Laravel 5
- Code cleanup