Skip to content

Instantly share code, notes, and snippets.

@ajbonner
Created February 6, 2014 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajbonner/8842843 to your computer and use it in GitHub Desktop.
Save ajbonner/8842843 to your computer and use it in GitHub Desktop.
Intervention Watermarking with Cache
<?php
$filestore = new \Illuminate\Cache\FileStore(
new \Illuminate\Filesystem\Filesystem(),
'/some/path/to/somewhere/specific/intervention-cache');
$repository = new \Illuminate\Cache\Repository($filestore);
$cache = new \Intervention\Image\ImageCache($repository);
$watermark = $cache->make($watermarkFile)->get(0, true);
$watermarkedImage = $cache->make($srcFile)->insert($watermark, $xPos, $yPos, $anchor)->get(0, true);
return $watermarkedImage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment