2017 © Pedro Peláez
 

library powerimage

Laravel Package to create a dynamic image handler

image

alcodo/powerimage

Laravel Package to create a dynamic image handler

  • Thursday, March 22, 2018
  • by approached
  • Repository
  • 1 Watchers
  • 13 Stars
  • 6,597 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 15 % Grown

The README.md

Powerimage

Build Status Total Downloads Latest Stable Version License , (*1)

Powerimage is a dynamic image handler for laravel. It uses the package thephpleague/glide for convert and spatie/image-optimizer for optimize the image., (*2)

After the installation you can request any image that you have uploaded in laravel. Example:
example.com/images/cat.jpg (Original)
example.com/images/cat_w=200&h=200.jpg (Convert), (*3)

The workflow is very simple. If image isn't found, laravel throw a exception. This package creates only one time this image. And on the next request the image will return form your webserver like nginx (fast response)., (*4)

Structure:, (*5)

{domain}/{path}/{fileimage name}_{resize parameter}.{extension}

Delimiter: _

Installation

Add packages:, (*6)

    composer require alcodo/powerimage:dev-master

Add powerimage handler in app/Exceptions/Handler.php:, (*7)

    public function render($request, Exception $exception)
    {
        PowerImage::check($request, $exception);

        return parent::render($request, $exception);
    }

And by the way you can inlcude or exclude paths that you want use powerimage example:, (*8)

    public function render($request, Exception $exception)
    {
        if (PowerImage::include ($request, ['/images/*', '/gallery/*'])) {
            PowerImage::check($request, $exception);
        }

        // or

        if (PowerImage::exclude($request, ['/user/*'])) {
            PowerImage::check($request, $exception);
        }

        return parent::render($request, $exception);
    }

Helper

Create powerimage path helper:, (*9)

    powerimage('images/video.png', ['w' => 200, 'h' => 350]);

    // outut
    'images/video_w=200&h=350.png'

    // or direct in blade template
    <img class="img-fluid" src="{{ powerimage(Storage::url($image->filepath), ['w'=> 260, 'h' => 260])  }}" alt=""/>

License

The MIT License (MIT). Please see LICENSE for more information., (*10)

The Versions

22/03 2018

dev-master

9999999-dev https://github.com/alcodo/powerimage

Laravel Package to create a dynamic image handler

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel http image glide dynamic

07/03 2018

dev-analysis-XljGpN

dev-analysis-XljGpN https://github.com/alcodo/powerimage

Laravel Package to create a dynamic image handler

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel http image glide dynamic

07/03 2018

dev-analysis-8npkvA

dev-analysis-8npkvA https://github.com/alcodo/powerimage

Laravel Package to create a dynamic image handler

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel http image glide dynamic

04/03 2018

dev-analysis-zepEVe

dev-analysis-zepEVe https://github.com/alcodo/powerimage

Laravel Package to create a dynamic image handler

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel http image glide dynamic