PHP code example of johnrich85 / teamwork

1. Go to this page and download the library: Download johnrich85/teamwork library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

johnrich85 / teamwork example snippets


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

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

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

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

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



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

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

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

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