2017 © Pedro Peláez
 

library laravel-teamwork

PHP wrapper for the Teamwork project management API

image

ciromattia/laravel-teamwork

PHP wrapper for the Teamwork project management API

  • Thursday, April 26, 2018
  • by ciromattia
  • Repository
  • 2 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 47 Forks
  • 0 Open issues
  • 15 Versions
  • 100 % Grown

The README.md

Laravel Service Provider for Teamwork

teamwork-developer, (*1)

Scrutinizer Code Quality Code Coverage Build Status Release License, (*2)

This package aims to implement the Teamwork API in a Service Provider for Laravel 5., (*3)

Installation

Add the package through composer:, (*4)

composer require "ciromattia/laravel-teamwork:~1.3"

Laravel Setup

The Service Provider is auto-discoverable by Laravel 5.5+., (*5)

If you're using Laravel 5.4 or earlier, you have to manually add the following to your config/app.php file., (*6)

'providers' => [
    ...
    'Ciromattia\Teamwork\TeamworkServiceProvider',
],

and then add the facade to your aliases array, (*7)

'aliases' => [
    ...
    'Teamwork' => 'Ciromattia\Teamwork\Facades\Teamwork',
],

Configuration

Add a teamwork array to your config/services.php file, (*8)

...
'teamwork' => [
    'key'  => 'YourSecretKey',
    'url'  => 'YourTeamworkUrl'
],

Use

There are two ways to use this stuff: the first is by the Teamwork Facade, like this, (*9)

Teamwork::people()->all();

If you want to use dependency injection to make your application easy to test, the Service Provider binds Ciromattia\Teamwork\Factory. Here is an example of how to use it with dependency injection, (*10)

Route::get('/test', function(Ciromattia\Teamwork\Factory $teamwork) {
   $activity = $teamwork->activity()->latest();
});

Methods

The methods available mimic the Teamwork entities in lowercase and query the namesake API, so you can retrieve e.g. a single project with:, (*11)

Teamwork::project($project_id)->find();

Common methods available to all the entities are: * all() - returns all the query results (i.e. all the entity objects). * find($id) - returns a single object with the specified ID. * create($data) - creates a single object with $data parameters.
* update($data) - updates a single object with $data parameters. * delete($id) - deletes a single object with the specified ID., (*12)

The implemented entities at the moment are: * Comments * Company * Links * Message * Milestone * People * Project * Task * Tasklist * Time, (*13)

The following special entities don't have the common methods specified above: * Account * Activity, (*14)

Configuration Without Laravel

If you are not using Laravel you can instantiate the class like this, (*15)

require "vendor/autoload.php";

use GuzzleHttp\Client as Guzzle;
use Ciromattia\Teamwork\Client;
use Ciromattia\Teamwork\Factory as Teamwork;

$client     = new Client(new Guzzle, 'YourSecretKey', 'YourTeamworkUrl');
$teamwork   = new Teamwork($client);

You are ready to go now!, (*16)


Examples

Not all of the Teamwork API is supported yet but there is still a lot you can do! Below are some examples of how you can access Projects, Companies, and more. To work with a specific Object pass in the ID to perform actions on it. Data can be passed through for creating and editing., (*17)

To see more examples visit the docs, (*18)

// create a project
$teamwork->project()->create([
    "name" => "My New Amazing Project",
    "description" => "This is a project that I will dedicate my whole life too",
    "companyId" => "999"
]);

// get the latest activity on a project
$teamwork->project($projectID)->activity();

Roadmap

2.0 Release

  • [ ] Add support for paging
  • [X] Add Support For Comments
  • [ ] Add Support For Permissions
  • [ ] Add Support For Categories
  • [ ] Add Support For People Status
  • [ ] Add Support For Files
  • [ ] Add Support For Notebooks

Credits

This library is an evolution of the now abandoned Teamwork 5 PM API Bridge by Ross Edman., (*19)

The Versions

26/04 2018

dev-master

9999999-dev

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman
by Ciro Mattia Gonano

laravel api project management teamwork

26/04 2018

v1.3

1.3.0.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman
by Ciro Mattia Gonano

laravel api project management teamwork

27/11 2017

v1.1.5

1.1.5.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

13/09 2017

v1.1.4

1.1.4.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

13/09 2017

v1.1.3

1.1.3.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

06/09 2017

v1.1.2

1.1.2.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

06/09 2017

v1.1.1

1.1.1.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

02/03 2017

v1.1.0

1.1.0.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

12/04 2016

v1.0.6

1.0.6.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

05/02 2016

v1.0.5

1.0.5.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

27/01 2016

v1.0.4

1.0.4.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

18/11 2015

v1.0.3

1.0.3.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

07/08 2015

v1.0.2

1.0.2.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

16/06 2015

v1.0.1

1.0.1.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork

25/05 2015

v1.0.0

1.0.0.0

PHP wrapper for the Teamwork project management API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ross Edman

laravel api project management teamwork