PHP code example of xfix / myriad

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

    

xfix / myriad example snippets


use Xfix\Myriad\Core\Myriad;
use Xfix\Myriad\Models\Post;

$myriad = new Myriad([
    'facebook' => [
        'app_id' => 'FB_APP_ID',
        'app_secret' => 'FB_APP_SECRET',
    ],
    'instagram' => [
        'app_id' => 'IG_APP_ID',
    ],
    'linkedin' => [
        'app_id' => 'LI_APP_ID',
    ],
    'tiktok' => [
        'app_id' => 'TT_APP_ID',
    ],
]);

$myriad->auth()->setToken('facebook', 'ACCESS_TOKEN', [
    'page_id' => 'PAGE_ID',
]);

$post = new Post();

$post->setContent('Hello from Xfix Myriad!')
     ->addMedia('/path/to/image.jpg');

$result = $myriad
    ->facebook()
    ->posts()
    ->publish($post);

if ($result->isSuccess()) {
    echo $result->getPostId();
}
text
src/
├── Core/
│   ├── Myriad.php
│   ├── AuthManager.php
│   ├── Config.php
│   └── HttpClient.php
│
├── Platform/
│   ├── PlatformInterface.php
│   ├── Facebook/
│   ├── Instagram/
│   ├── LinkedIn/
│   └── TikTok/
│
├── Services/
│   ├── Scheduler.php
│   ├── ContentLibrary.php
│   ├── WebhookHandler.php
│   └── AnalyticsAggregator.php
│
├── Models/
├── Exceptions/
└── Utils/