PHP code example of disruptiveadvertising / teamwork

1. Go to this page and download the library: Download disruptiveadvertising/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/ */

    

disruptiveadvertising / teamwork example snippets


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

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

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

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

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



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);

// 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();