chipslays / imgfy-api
Official API wrapper for Imgfy.cf
1.0.1
2021-02-05 20:18 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-01-06 21:27:55 UTC
README
Imgfy - is a simple and beautiful service for uploading images.
Installation
$ composer require chipslays/imgfy-api
Methods
upload
Upload image to Imgfy.cf:
Imgfy::upload(string|array $images [, bool $secretly = false]) : array
Upload single image:
use Chipslays\Imgfy\Imgfy; require __DIR__ . '/vendor/autoload.php'; $response = Imgfy::upload('potato.png'); print_r($response); Array ( [0] => Array ( [filename] => potato.png [preview] => https://imgfy.cf/hs7oe [source] => https://imgfy.cf/file/b49432863e12495ddf099.png ) )
Upload multiple images:
use Chipslays\Imgfy\Imgfy; require __DIR__ . '/vendor/autoload.php'; $response = Imgfy::upload([ 'potato.png', 'chips.jpg', ]); print_r($response); Array ( [0] => Array ( [filename] => potato.png [preview] => https://imgfy.cf/hs7oe [source] => https://imgfy.cf/file/b49432863e12495ddf099.png ) [1] => Array ( [filename] => chips.png [preview] => https://imgfy.cf/hs7od [source] => https://imgfy.cf/file/b39423123e15595dfd019.png ) )
Generate super-secretly links:
use Chipslays\Imgfy\Imgfy; require __DIR__ . '/vendor/autoload.php'; $response = Imgfy::upload('potato.png', true); print_r($response); Array ( [0] => Array ( [filename] => potato.png [preview] => https://imgfy.cf/z:maewitZhZRKPD [source] => https://imgfy.cf/file/b32166863eaf495ddf079.png ) )
Short alias upload_imgfy
function.
$response = upload_imgfy('potato.png'); $response = upload_imgfy(['potato.png', 'chips.jpg']); // super-secretly link $response = upload_imgfy('potato.png', true); $response = upload_imgfy(['potato.png', 'chips.jpg'], true);