Laravel Clyde — image uploads, resizing & manipulations for Laravel
January 27, 2016 🕒 < 1 min
It's very common for web applications to deal with image uploads, image resizing and other manipulations. Arguably the best approach to the problem (apart from offloading the task to a service like imgix) is to store the uploads in the cloud and resize and manipulate the images on the fly. This approach offers a lot of flexibility to resize images to any size at any time and it can still work reasonably fast if the resized images get cached.
The good news is this is a problem already solved by glide — wonderfully easy on-demand image manipulation library with an HTTP based API.
Since glide is a universal library that works in any PHP project, all that's really needed to start using it with Laravel is a little bit of glue code. Laravel Clyde removes all complexity from setting up glide and using it with Laravel.
When using Laravel Clyde I prefer to upload images to S3 and store cached files on local filesystem.
// config/clyde.php return [ 'source' => 's3', 'cache' => 'local', ...
For more detailed documentation see the README.
Using laravel-clyde or glide is convenient, but not exactly performant. You've been warned, proceed with caution. ⚠️