Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

Commit db20825

Browse files
committed
bump version
1 parent 8ec2cb3 commit db20825

File tree

3 files changed

+106
-370
lines changed

3 files changed

+106
-370
lines changed

README.md

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -9,110 +9,4 @@
99

1010
Laravel-Imgur is super easy upload image to imgur package.
1111

12-
## Requirement
13-
#### laravel 5 or later
14-
15-
## Installation
16-
17-
Install via composer
18-
``` bash
19-
$ composer require yish/imgur
20-
```
21-
22-
If you use 5.5 or later, you don’t need to add provider into app.php, just use discovery autoloading.
23-
``` php
24-
Yish\Imgur\UploadServiceProvider::class,
25-
```
26-
27-
### Facade binding
28-
app.php
29-
``` php
30-
'Imgur' => Yish\Imgur\Facades\Upload::class,
31-
```
32-
33-
### Publish config
34-
``` bash
35-
$ php artisan vendor:publish
36-
```
37-
38-
## Usage
39-
``` php
40-
Imgur::upload($args);
41-
```
42-
43-
Arguments can be a image link or file, for example, you can pass a https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_logo_black.svg/1200px-Apple_logo_black.svg.png or use file upload *MUST* instance of `Illuminate\Http\UploadedFile` .
44-
45-
### Customize
46-
If you want to customize your headers or form params, you can do belong:
47-
48-
``` php
49-
Imgur::setHeaders([
50-
'headers' => [
51-
'authorization' => 'Client-ID ' . env('IMGUR_CLIENT_ID'),
52-
'content-type' => 'application/x-www-form-urlencoded',
53-
]
54-
])->setFormParams([
55-
'form_params' => [
56-
'image' => $image,
57-
]
58-
])->upload($image);
59-
```
60-
61-
## Quick Starter
62-
You can use methods to get what you want informations.
63-
64-
``` php
65-
$image = Imgur::upload($file);
66-
67-
// Get imgur image link.
68-
$image->link(); //"https://i.imgur.com/XN9m1nW.jpg"
69-
70-
// Get imgur image file size.
71-
$image->fileszie(); //43180
72-
73-
// Get imgur image file type.
74-
$image->type(); //"image/jpeg"
75-
76-
// Get imgur image width.
77-
$image->width(); //480
78-
79-
// Get imgur image height.
80-
$image->height(); //640
81-
82-
// Or you can get usual data.
83-
$image->usual();
84-
85-
//[
86-
// 'link' => "https://i.imgur.com/XN9m1nW.jpg",
87-
// 'filesize' => 43180,
88-
// 'type' => "image/jpeg",
89-
// 'width' => 480,
90-
// 'height' => 640,
91-
//]
92-
```
93-
94-
Sometimes, you need get more image size, you can call `size` to get more thumbnails.
95-
``` php
96-
97-
$image = Imgur::upload($file);
98-
99-
// Support: https://api.imgur.com/models/image
100-
101-
// Get small square.
102-
$small_square = Imgur::size($image->link(), 's');
103-
104-
// Get big square thumbbnail.
105-
$small_square = Imgur::size($image->link(), 'b');
106-
107-
// Get small small thumbbnail.
108-
$small_square = Imgur::size($image->link(), 't');
109-
110-
// Get small medium thumbbnail.
111-
$small_square = Imgur::size($image->link(), 'm');
112-
113-
// Get small large thumbbnail.
114-
$small_square = Imgur::size($image->link(), 'l');
115-
116-
// Get small huge thumbbnail.
117-
$small_square = Imgur::size($image->link(), 'h');
118-
```
12+
https://packages.yish.dev/packages/laravel-imgur.html

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
}
1212
],
1313
"require": {
14-
"guzzlehttp/guzzle": "^6.3"
14+
"php": ">=7.2",
15+
"guzzlehttp/guzzle": "^7.2"
1516
},
1617
"autoload": {
1718
"psr-4": {
@@ -23,7 +24,10 @@
2324
"laravel": {
2425
"providers": [
2526
"Yish\\Imgur\\UploadServiceProvider"
26-
]
27+
],
28+
"aliases": {
29+
"Imgur": "Yish\\Imgur\\Facades\\Upload"
30+
}
2731
}
2832
}
2933
}

0 commit comments

Comments
 (0)