Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Image Editor

Muah edited this page Jan 11, 2018 · 25 revisions

Starting from v2.5.0, we now have a full image editor that can "crop, zoom, flip, rotate", pretty much everything cropperjs offers + almost all of the filters camanjs have.

Optimize Edited Images On Save

if you use any of the image optimizers that runs on the uploaded files you will surely miss that option as it's not possible to have the same over the editor result but gladly there is a way around that.

for example using https://github.com/spatie/laravel-image-optimizer we can run the optimization on the fly through an event like so

Event::listen('MMFileCropped', function ($file_path) {
    app(\Spatie\ImageOptimizer\OptimizerChain::class)->optimize($file_path);
});

so every time you save an image

  • it gets saved to disk
  • then it gets optimized 💥 💪

Notes

Clone this wiki locally