Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meemalabs/meema-client-php

โšก๏ธ A fully-featured & blazing-fast PHP API client to interact with all of Meema's functionalities. ๐Ÿ‘
https://github.com/meemalabs/meema-client-php

image-editing media media-management meema-api meema-client-php php video-converter video-streaming

Last synced: about 1 month ago
JSON representation

โšก๏ธ A fully-featured & blazing-fast PHP API client to interact with all of Meema's functionalities. ๐Ÿ‘

Awesome Lists containing this project

README

        



Meema for PHP

The most simple way to integrate Meema and your PHP project


Scrutinizer
Total Downloads
Latest Version
License


Documentation โ€ข
Laravel โ€ข
Report a bug โ€ข
FAQ โ€ข
Discord

## ๐Ÿ™ Features

- Most simple way to implement a fully-functional media management system
- Thin & minimal package to interact with Meema's API
- Supports PHP `^7.*`

## ๐Ÿ’ก Usage

First, install Meema PHP API Client via the [composer](https://getcomposer.org/) package manager:

```bash
composer require meema/meema-client-php
```

Then, initialize the Client

```php
use Meema\MeemaClient\Client

$client = new Client($meemaApiKey);
```

Using the `Media` model

```php
$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 require an id
$media->update('updated-media-name')
$media->delete();
$media->archive();
$media->unarchive();
$media->makePrivate();
$media->makePublic();
$media->duplicate();

// Relationships with other models.
// Continuing with the chaining of methods we used earlier.
$media->folders()->get();
$media->folders()->create('New folder name');
$media->folders()->delete('11a283ed-a64e-424a-aefc-6aa98971d529');
$media->tags()->get();
$media->tags()->associate(['name' => 'Tag Name']);
$media->tags()->disassociate(['name' => 'Tag Name']);
```

Using the `Folder` model

```php
$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 require an id
$folder->update('updated-folder-name')
$folder->delete();
$folder->archive();
$folder->unarchive();
$folder->duplicate();

// Relationships with other models.
// Continuing with the chaining of methods we used earlier.
$folder->media()->get();
$folder->tags()->get();
$folder->tags()->associate(['tag_id' => 7]);
$folder->tags()->disassociate(['tag_id' => 7]);
```

Using the `Tag` model

```php
$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 require an id
$tag->update('red-500'); // You will have to use tailwind CSS color palletes.
$tag->delete();
$tag->media()->get();
```

Using the `Favorite` model

```php
$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 require an id
$favorite->update(['name' => 'Updated Favorite Name', 'icon' => 'updated-favorite-icon']);
$favorite->delete();
```

Using the `Storage` model

```php
$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');
```

In order to use any of our "On-The-Fly" image & video operations, read more **[here](https://docs.meema.io/on-the-fly)**

For the full documentation, visit the **[Meema PHP API Client](https://docs.meema.io/open-source/)**.

## ๐Ÿงช Testing

``` bash
composer test
```

## ๐Ÿ“ˆ Changelog

Please see our [releases](https://github.com/meemalabs/meema-client-php/releases) page for more information on what has changed recently.

## ๐Ÿ’ช๐Ÿผ Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## ๐Ÿ Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Meema PHP on GitHub](https://github.com/meemalabs/meema-client-php/discussions)

For casual chit-chat with others using this package:

[Join the Meema Discord Server](https://discord.meema.io)

## ๐Ÿšจ Security

Please review [our security policy](https://github.com/meemalabs/meema-client-php/security/policy) on how to report security vulnerabilities.

## ๐Ÿ™๐Ÿผ Credits

- [Chris Breuer](https://github.com/Chris1904)
- [Folks at Meema](https://github.com/meemalabs)
- [All Contributors](../../contributors)

## ๐Ÿ“„ License

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

Made with โค๏ธ by Meema, Inc.