meemalabs/meema-client-php
publicClone
Push over the same URL. A password will not work: create a token under access tokens and use it in place of one.
⚡️ A fully-featured & blazing-fast PHP API client to interact with all of Meema's functionalities. 🐑
- .github
- data
- src
- tests
- .editorconfig 338 B
- .env.example 100 B
- .gitattributes 395 B
- .gitignore 45 B
- .scrutinizer.yml 874 B
- .styleci.yml 66 B
- CHANGELOG.md 130 B
- composer.json 1.2 KB
- composer.lock 291.4 KB
- LICENSE.md 1.0 KB
- phpunit.xml 619 B
- README.md 6.3 KB
<h4 align="center">The most simple way to integrate Meema and your PHP project</h4>
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-phpThen, 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.
