Skip to content

Commit e9cb64d

Browse files
committed
Update readme
1 parent 91ffc36 commit e9cb64d

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,41 @@ This package provides a fluent API to generate Cloudflare Image Resizing URLs.
4141

4242
### 🚀 Usage
4343

44+
#### Generating a URL without any transformations
45+
46+
```php
47+
use AneesKhan47\CloudflareImageResizing\CFImageResizing;
48+
49+
$url = 'https://example.com/uploads/2023/image.jpg';
50+
51+
$image = CFImageResizing::make($url)->build();
52+
53+
// output:
54+
// https://example.com/cdn-cgi/image/format=auto/uploads/2023/image.jpg
55+
```
56+
57+
#### Generating a URL with transformations
58+
4459
```php
4560
use AneesKhan47\CloudflareImageResizing\CFImageResizing;
4661

4762
$url = 'https://example.com/uploads/2023/image.jpg';
4863

4964
$image = CFImageResizing::make($url)
50-
->width(300)
51-
->height(300)
52-
->webp()
53-
->quality(80)
54-
->build();
65+
->width(300)
66+
->height(300)
67+
->webp()
68+
->quality(80)
69+
->build();
5570

71+
// output:
5672
// https://example.com/cdn-cgi/image/width=300,height=300,format=webp,quality=80/uploads/2023/image.jpg
5773
```
5874

75+
#### Available transformations
76+
77+
Please see the available transformations [here](src/Concerns/HasOptions.php).
78+
5979
------
6080

6181
### 🧪 Testing

0 commit comments

Comments
 (0)