Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Handling media in a Laravel app (Laracon US)

Handling media in a Laravel app (Laracon US)

Freek Van der Herten

July 25, 2018

More Decks by Freek Van der Herten

Other Decks in Programming


  1. Handling media
 in a Laravel app

  2. The problem User uploaded content Where to store it all?

    How to retrieve it? How to optimize images?
  3. Laravel 

  4. Laravel Medialibrary Associate files with Eloquent models Can group media

    into collections Image conversions Uses multiple filesystems
  5. Laravel Medialibrary Optimize converted images Custom image generators Customize directory

    structure Custom attributes
  6. Add file
 Upload, copy, … New media Derived formats

    crops, thumbs, … Existing model
 Eg. news item Disks
 Local or remote Database
  7. https://docs.spatie.be/laravel-medialibrary

  8. None
  9. Demo

  10. Wrapping up

  11. Resources https://github.com/spatie/medialibrary-demo-laracon-us

  12. Coming soon Vue components
 Administering a media

 Release Q3 - Q4 2018
  13. Teamwork Sebastian De Deyne
 Willem Van Bockstal

 Alex Vanderbist
 Brent Roose
  14. Thank you! Freek Van der Herten Partner & developer at

    SPATIE https://spatie.be/open-source https://ohdearapp.com https://murze.be