Skip to content

Instantly share code, notes, and snippets.

@drsii
Last active January 2, 2016 20:59
Show Gist options
  • Save drsii/8360815 to your computer and use it in GitHub Desktop.
Save drsii/8360815 to your computer and use it in GitHub Desktop.
@media() outline

Media Package: handles file storage, directory dispersion, & image manipulation.

Media Extension: handles upload, media listing, & media helpers (blade calls)

When a file is uploaded, it is stored in its original format to the public/media folder following the directory dispersion method as configured.

We then provide a series of blade calls to help developers utilize their media assets.

###@media() returns an output based on media mime type

###@media('type')

the type parameter sets the desired result based on mime type. application, image, video

@media('application', 'entity')

returns a direct path to the original asset

@media('image', 'entity', 'height', 'width')

returns path of the cached image that is generated. The Generated filename should be filename-width-height.exstension

@media('video', 'entity')

returns path to the video

We do not need to do anything more, any additional logice can be handled by the developer. In later versions we may include widgets that return the markeup for images and videos etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment