meema / meema-client-php
โก๏ธ A fully-featured & blazing-fast PHP API client to interact with Meema. ๐
Requires
- php: ^7.0|^8.0
- guzzlehttp/guzzle: ^7.2
- illuminate/support: ^8.35
- vlucas/phpdotenv: ^5.3
Requires (Dev)
- orchestra/testbench: ^6.17
- pestphp/pest: ^1.0
Suggests
- illuminate/support: If you prefer to work with Collections instead of arrays, you need to require this package
- dev-main
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dependabot/composer/guzzlehttp/guzzle-7.5.0
- dev-renovate/configure
- dev-dependabot/composer/vlucas/phpdotenv-5.4.0
- dev-dependabot/composer/pestphp/pest-1.21.1
- dev-dependabot/composer/orchestra/testbench-6.21.0
- dev-change-test-yml
- dev-collection-response
- dev-tag-attach
- dev-bulk-folders
- dev-bulk-media
This package is auto-updated.
Last update: 2024-10-29 06:06:15 UTC
README
The most simple way to integrate Meema and your PHP project
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 package manager:
composer require meema/meema-client-php
Then, initialize the Client
use Meema\MeemaClient\Client $client = new Client($meemaApiKey);
Using the Media
model
$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
$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
$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
$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
$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
For the full documentation, visit the Meema PHP API Client.
๐งช Testing
composer test
๐ Changelog
Please see our releases page for more information on what has changed recently.
๐ช๐ผ Contributing
Please see CONTRIBUTING for details.
๐ Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
๐จ Security
Please review our security policy on how to report security vulnerabilities.
๐๐ผ Credits
๐ License
The MIT License (MIT). Please see LICENSE for more information.
Made with โค๏ธ by Meema, Inc.