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
Tweet

More Decks by Freek Van der Herten

Other Decks in Programming

Transcript

  1. Handling media

    in a Laravel app

    View Slide

  2. The problem
    User uploaded content
    Where to store it all?
    How to retrieve it?
    How to optimize images?

    View Slide

  3. Laravel 

    Medialibrary

    View Slide

  4. Laravel Medialibrary
    Associate files with Eloquent models
    Can group media into collections
    Image conversions
    Uses multiple filesystems

    View Slide

  5. Laravel Medialibrary
    Optimize converted images
    Custom image generators
    Customize directory structure
    Custom attributes

    View Slide

  6. Add file

    Upload, copy, …
    New media
    Derived formats

    Srcset, crops, thumbs, …
    Existing model

    Eg. news item
    Disks

    Local or remote
    Database

    View Slide

  7. https://docs.spatie.be/laravel-medialibrary

    View Slide

  8. View Slide

  9. Demo

    View Slide

  10. Wrapping up

    View Slide

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


    https://docs.spatie.be/laravel-medialibrary/v7


    https://www.youtube.com/watch?v=4lq_6JLR2H8


    https://github.com/spatie/laravel-medialibrary


    View Slide

  12. Coming soon
    Vue components


    Uploads


    Administering a media collection


    Release Q3 - Q4 2018

    View Slide

  13. Teamwork
    Sebastian De Deyne

    @sebdedeyne


    Willem Van Bockstal

    @willemvbockstal


    Alex Vanderbist

    @alexvanderbist


    Brent Roose

    @brendt_gd

    View Slide

  14. Thank you!
    Freek Van der Herten
    Partner & developer at SPATIE
    https://spatie.be/open-source
    https://ohdearapp.com
    https://murze.be

    View Slide