Skip to content

Commit 3f6d03d

Browse files
committed
edit reamde
1 parent a16cd86 commit 3f6d03d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,18 @@ app(Spatie\ImageOptimizer\OptimizerChain::class)->optimize($pathToImage);
170170

171171
All images that in requests to routes that use the `optimizeImages`-middleware will be optimized automatically.
172172

173+
```php
173174
Route::middleware('optimizeImages')->group(function () {
174-
//all images will be optimized automatically
175+
// all images will be optimized automatically
175176
Route::post('upload-images', 'UploadController@index);
176177
});
178+
```
179+
180+
### Adding your own optimizers
181+
182+
To learn how to create your own optimizer read [the "Writing custom optimizers" section](https://github.com/spatie/image-optimizer#writing-a-custom-optimizers) in the readme of the underlying [spatie/image-optimizer](https://github.com/spatie/image-optimizer#writing-a-custom-optimizers) package.
183+
184+
You can add the fully qualified classname of your optimizer as a key in the `optimizers` array in the config file.
177185

178186
## Changelog
179187

0 commit comments

Comments
 (0)