Package Data | |
---|---|
Maintainer Username: | baqirfarooq |
Maintainer Contact: | bmconcepts@hotmail.com (Baqir Farooq) |
Package Create Date: | 2017-02-19 |
Package Last Update: | 2018-01-20 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-26 15:18:53 |
Package Statistics | |
---|---|
Total Downloads: | 35 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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:
Just add this to your composer.json
and then run composer update
.
"baqirfarooq/teamwork": "~1.0"
You can also simply add it like this
composer require "baqirfarooq/teamwork:~1.0"
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' => [
...
'Baqirfarooq\Teamwork\TeamworkServiceProvider',
],
and then add the facade to your aliases
array
'aliases' => [
...
'Teamwork' => 'Baqirfarooq\Teamwork\Facades\Teamwork',
],
If you are using Laravel then add a teamwork
array to your config/services.php
file
...
'teamwork' => [
'key' => 'YourSecretKey',
'url' => 'YourTeamworkUrl'
],
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 Baqirfarooq\Teamwork\Factory
. Here is an example of how to use it with dependency injection
Route::get('/test', function(Baqirfarooq\Teamwork\Factory $teamwork) {
$activity = $teamwork->activity()->latest();
});
If you are not using Laravel you can instantiate the class like this
require "vendor/autoload.php";
use GuzzleHttp\Client as Guzzle;
use Baqirfarooq\Teamwork\Client;
use Baqirfarooq\Teamwork\Factory as Teamwork;
$client = new Client(new Guzzle, 'YourSecretKey', 'YourTeamworkUrl');
$teamwork = new Teamwork($client);
You are ready to go now!
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" => "12345"
]);
// get the latest activity on a project
$teamwork->project($projectID)->activity();
Comments
Permissions
Time
EndpointCategories
People Status
Files
Notebooks