Blade component for serving images and downloading files

Smart allows streaming images and downloading files from any location including Laravel disks in a Laravel application. It allows resizing and caching images before sending them to the browser. Templates make it easy to pre-configure your settings for use throughout your site.

Smart allows for easy image manipulation and uploads without any backend code:

  • serving pictures from anywhere, it can be public path, private path or laravel disk
  • resize images not only setting the height and width in the html image tag, but actually resizing the content passed to the browser
  • apply templates to images, change settings for all images from one place
  • automatically hidden your pictures
  • Apply the Intervention/Full Image API to a picture
  • Download files from anywhere, it can be public path, private path or laravel disk

Using S3 as an example, here’s how you can load an image from an S3-compatible storage drive:

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

Smart download is another unique feature offered by this package, allowing to download any image or file with blade component. No need to program the backend part of the code to provide file streams; this package handles all of that:

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

The readme file contains many examples to help you get started with this package. The author also has a video demonstration for those who want hands-on visual examples:

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


Source link

Comments are closed.