https://github.com/chipslays/imgfy-api
🎨 Official PHP API wrapper for Imgfy.cf
https://github.com/chipslays/imgfy-api
image-host image-hosting image-upload image-upload-php image-uploader
Last synced: 3 months ago
JSON representation
🎨 Official PHP API wrapper for Imgfy.cf
- Host: GitHub
- URL: https://github.com/chipslays/imgfy-api
- Owner: chipslays
- Created: 2021-02-05T20:08:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-06T11:59:37.000Z (over 4 years ago)
- Last Synced: 2025-01-03T04:52:36.537Z (5 months ago)
- Topics: image-host, image-hosting, image-upload, image-upload-php, image-uploader
- Language: PHP
- Homepage: https://imgfy.cf
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎨 Imgfy [API](https://imgfy.cf/api)
[**Imgfy**](https://imgfy.cf/) - is a simple and beautiful service for uploading images.
## Installation
```bash
$ composer require chipslays/imgfy-api
```## Methods
### `upload`
Upload image to Imgfy.cf:
```
Imgfy::upload(string|array $images [, bool $secretly = false]) : array
```Upload single image:
```php
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:
```php
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:
```php
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.
```php
$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);
```