PHP code example of jcolombo / paymo-api-php

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

    

jcolombo / paymo-api-php example snippets



use Jcolombo\PaymoApiPhp\Paymo;
use Jcolombo\PaymoApiPhp\Entity\Resource\Project;

// Start a connection with the Paymo API
$paymo = Paymo::connect('YOUR_API_KEY');

// Load a specific project by its ID
$project = new Project();
$project -> fetch(12345);
// OR
$project = Project::new()->fetch(12345);
// $project is now fully populated with the data from the matching Paymo project

// Load a project with all the client details attached to it
$project -> fetch(12345, ['client']);
// OR
$project = Project::new()->fetch(12345, ['client']);

// Load a list of all projects the API key can see
$projects = Project::list()->fetch();

// Creating a new Project
$project = new Project();
$project -> name = "My Fake Project";
$project -> create();
// $project exists now in paymo, object is populated with full project data from response
// Alternative create with chaining

$project = Project::new()->set(['name'=>'My Fake Project'])->create();



composer