New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

morningtrain/teamwork

PHP wrapper for the Teamwork project management API
185
Install
composer require morningtrain/teamwork
Latest Version:v1.1.6
PHP:>=5.4.0
License:MIT
Last Updated:Sep 21, 2018
Links: GitHub  ·  Packagist
Maintainer: morningtrain

Laravel 5 Teamwork PM API Bridge

teamwork-graphic

Scrutinizer Code Quality Code Coverage Build Status Release License

This is a simple PHP Client that can connect to the Teamwork API. This package was developed to be used with Laravel 5 but can also be used stand alone as well. I hope this helps you automate and extend Teamwork to integrate even more into your business! Have fun and good luck. :metal:

Installation

Just add this to your composer.json and then run composer update.

"rossedman/teamwork": "~1.0"

You can also simply add it like this

composer require "rossedman/teamwork:~1.0"

Laravel Setup

This wrapper comes with support for Laravel 5. This includes a service provider as well as a facade for easy access. Once this package is pulled into your project just add this to your config/app.php file.

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

and then add the facade to your aliases array

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

Configuration

If you are using Laravel then add a teamwork array to your config/services.php file

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

Use

If you are using the Facade with Laravel youc an easily access Teamwork like this

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

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

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

Configuration Without Laravel

If you are not using Laravel you can instantiate the class like this

require "vendor/autoload.php";

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

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

You are ready to go now!


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.

To see more examples visit the docs

// 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

1.1 Release
  • Add Support For Comments
  • Add Support For Permissions
  • Add Support For Time Endpoint
1.2 Release
  • Add Support For Categories
  • Add Support For People Status
  • Add Support For Files
  • Add Support For Notebooks

Related Packages

baqirfarooq/laravel-teamwork

PHP wrapper for the Teamwork project management API

38 1
railken/lara-eye
38,923 38
api
juampi92/api-resources

Manage your resources maintaining API versioning

934,502 111
tailflow/laravel-orion

Orion for Laravel allows you to build a fully featured REST API based on your El...

814,907 1,591
unlu/laravel-api-query-builder

Laravel API Query Builder Package.

720,455 329

Version History

Version Released PHP License
v1.1.6 >=5.4.0 MIT
v1.1.5 >=5.4.0 MIT
v1.1.4 >=5.4.0 MIT
v1.1.3 >=5.4.0 MIT
v1.1.2 >=5.4.0 MIT