Skip to content

Commit 4a55b47

Browse files
committed
Fixed issues with same folder names
1 parent ca37980 commit 4a55b47

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,46 @@
11
# Laravel Image Engine
2+
3+
Powerful Image engine for Laravel. Don't waste your time, writing logic to resize and transform images.
4+
5+
## Installation
6+
```
7+
composer require le0daniel/laravel-image-engine
8+
```
9+
After that, publish the configuration file using
10+
```
11+
artisan vendor:publish
12+
```
13+
14+
## Configuration
15+
16+
Configure the desired file sizes your application should provide in your configuration file.
17+
18+
Make sure all the required paths exist within your `image-engine.php` configuration file.
19+
20+
## Usage
21+
22+
The image engine is based on the `ImageRepresentation` class.
23+
```php
24+
use Carbon\Carbon;use le0daniel\Laravel\ImageEngine\Image\ImageRepresentation;
25+
26+
$image = ImageRepresentation::from(
27+
'file/path/relative/to/disk',
28+
'medium', // Desired image size defined in config
29+
null, // Expire Timestamp or Carbon
30+
'local' // name of the storage disk where the image is located
31+
);
32+
33+
$imgUrl = image_url($image, 'png' /* Desired output format: jpg | png */);
34+
```
35+
36+
This will generate an Image URL for you, which is signed. The image is only converted on demand, as soon as the first request is made to this url.
37+
The Image will be converted by Intervention Image to the specified format.
38+
39+
For better performance, the images are stored in the public folder. This enables nginx to serve the files once they have been generated. If the Image has an expirey date, the image is stored in the defined path from your config. In this case, php will serve the image, even tho it has been cached.
40+
41+
If you need a file for local processing (Ex: send in an email), simply use:
42+
```php
43+
image_real_path($image, 'png');
44+
```
45+
46+
This will return the local path of the converted image for you.

0 commit comments

Comments
 (0)