Example of Intervention/image in agorakit/agorakit

File composer.json (link to Github)
{
  "require": {
    "php": "^7.3",
    //
    "intervention/image": "^2"
  },
}
File app/Http/Controllers/GroupCoverController.php (link to Github)
use Image;

class GroupCoverController extends Controller
{
    public function small(Group $group)
    {
        $this->authorize('view', $group);

        $path = storage_path().'/app/groups/'.$group->id.'/cover.jpg';

        if (File::exists($path)) {
            $cachedImage = Image::cache(function ($img) use ($path) {
                return $img->make($path)->fit(128, 128);
            }, 5, true);

            return $cachedImage->response();
        } else {
            abort(404);
        }
    }
}

Additional resources on intervention/image: