• Reading time ~ 1 min
  • 24.08.2022

Smart makes it possible to serve images and download files from any location, including Laravel disks within a Laravel application. It enables resizing and caching images before sending them to the browser. Templates make it easy to preconfigure your settings to use them all over your site.

Smart enables easy image manipulation and downloads without any backend code:

  • serve images from anywhere, this might be a public path , a private path or a Laravel disk
  • resize images not only by defining height and width in the html image tag but by really resizing the content that is passed to the browser
  • apply templates to images, change the settings for all images from one place
  • automatically cache your images
  • apply the full intervention/image API to an image
  • download files from anywhere, this might be a public path , a private path or a Laravel disk

Using S3 as an example, here's how you can load an image from an S3 compatible storage disk:

<x-smart-image data-disk="s3" src="logos/mybrand.jpg"/>

Smart downloading is another unique feature this package offers, making it possible to download any image or file with a blade component. No need to program the backend portion of the code to provide file streams; this package handles all of that:

<x-smart-download src="{{ storage_path('manual.pdf') }}" target="_blank" />

The readme has plenty of examples to help you get started with this package. The author also has a video demonstration for those that want hands-on visual examples:

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297