PHP code example of meema / meema-client-php

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

    

meema / meema-client-php example snippets


use Meema\MeemaClient\Client

$client = new Client($meemaApiKey);

$client->media()->create('New media name');
$client->media()->get();

// specific uuids
$client->media()->get('11a283ed-a64e-424a-aefc-6aa98971d529', '1556fcb8-693e-4431-8b16-3b2b7bb8fcc7');
$client->media()->search('media-name');

// this will return a Response instance
$media = $client->media()->find('11a283ed-a64e-424a-aefc-6aa98971d529');

// you may chain other methods that 6aa98971d529');
$media->tags()->get();
$media->tags()->associate(['name' => 'Tag Name']);
$media->tags()->disassociate(['name' => 'Tag Name']);

$client->folders()->create('New folder name');
$client->folders()->get();

// specific uuids
$client->folders()->get('11a283ed-a64e-424a-aefc-6aa98971d529', '1556fcb8-693e-4431-8b16-3b2b7bb8fcc7');
$client->folders()->search('folder-name');

// this will return a Response instance
$folder = $client->folders()->find('11a283ed-a64e-424a-aefc-6aa98971d529');

// you may chain other methods that 

$client->tags()->get();

// Specific ids
$client->tags()->get(1, 2, 3);

// This will return a Response instance
$tag = $client->tags()->find(1);

// you may chain other methods that 

$client->favorites()->create(['name' => 'New Favorite Name', 'icon' => 'favorite-icon']);
$client->favorites()->get();

// specific ids
$client->favorites()->get(1,2,3);

// this will return a Response instance
$favorite = $client->favorites()->find(1);

// you may chain other methods that 

$client->storage()->upload('path/to/local/media/file');
$client->storage()->getMetadata('meema/path/to/file.jpg');

$client->storage()->setVisibility('meema/path/to/file.jpg', 'private'); // Or 'public'
$client->storage()->has('meema/path/to/file.jpg');
$client->storage()->delete('meema/path/to/file.jpg');
$client->storage()->copy('meema/path/to/file.jpg', 'meema/path/to/copied-file.jpg');
$client->storage()->rename('meema/path/to/file.jpg', 'meema/path/to/renamed-file.jpg');

$client->storage()->listContents('meema/path');
$client->storage()->makeDirectory('meema/path/new-folder');
bash
composer