Laravel Clyde — image uploads, resizing & manipulations for Laravel


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.

http://github.com/antennaio/laravel-clyde

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.

Did you like this post?
Previous post

Building a movie watchlist app with React

React is intriguing. It has a much smaller footprint than a full blown Javascript framework like Angular, it's component based and relies on one-way data flow. The JSX syntax is very different from what I'm used to, but after giving it a try having the markup and related Javascript code all in one place has some advantages to it.
Next post

Codeception — automated database dumps

I've been recently using Codeception and really appreciate what it can do. I see Codeception as a natural next step from PHPUnit. What's nice about Codeception is that existing classic PHPUnit tests are compatible with it, so not all work is lost for people moving from PHPUnit to Codeception...