PHP code example of omneo / omneo-php

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

    

omneo / omneo-php example snippets


// Get credentials, you should store these outside of your codebase
$domain = 'foo.omneoapp.io';
$token = '...';
​
// Instantiate the Omneo client
$omneo = new Omneo\Client($domain, $token);
​
// Optional, add the shared secret for verifying webhooks and targets
$omneo->setSecret('horsebatterystaple');
​
// Use the client to communicate with omneo
$profiles = $omneo->profiles()->browse();

'omneo' => [
    'domain' => env('OMNEO_DOMAIN'),
    'token' => env('OMNEO_TOKEN'),
    'secret' => env('OMNEO_SECRET')
]

class FooController extends Controller
{    
    public function getProfiles(Omneo\Client $omneo)
    {
        // Using typehints
        $profiles = $omneo->profiles()->browse();
        
        // Using the app() method
        $profiles = app(Omneo\Client::class)->profiles()->browse();
    }
}

composer 
ini
OMNEO_DOMAIN=
OMNEO_TOKEN=
OMNEO_SECRET=