Imagysey

Setup

Run php artisan apysey:generate in order to generate a random string key in the .env file. Like the following (for example) :

IMAGYSEY_KEY=W/KXCAT1PHArvYirnrkvtgFKicqCBrnSaIz70R2A+TY=

Imagysey uses this key in order to protect the associated route. To prevent a malicious person from spaming image generation.

Configuration

Now, go to config/imagysey.php. Here, you can change the default configuration.

Setting

Description

Default

route

env('IMAGYSEY_PATH', 'imagyseycache')

key

env('IMAGYSEY_KEY', null)

disks

array( 'public')

dynamicSize

If you want Apysey can resize images in order to serve an optimized image. This value need to be true.

false

middleware

[ 'web', 'auth']

namespace

[ 'controller' =>'/Dysey/Apysey/Http/Controllers/Imagysey']

templates

array( 'small' => 'Dysey/Imagysey/Filters/ImageFilters/Small', 'medium' => 'Dysey/Imagysey/Filters/ImageFilters/Medium', 'large' => 'Dysey/Imagysey/Filters/ImageFilters/Large', 'original' => 'Dysey/Imagysey/Filters/ImageFilters/Original', 'greyscale' => 'Dysey/Imagysey/Filters/ImageFilters/GreyScale', 'adminpanel' => 'Dysey/Imagysey/Filters/ImageFilters/AdminPanel' )

lifetime

43200

How to use?

Now, you can use Imagysey in your website. Like this :

<img src="{{ imagyseyImage($item->image, "original", 270, 270) }}" loading="lazy" />

If you want Imagysey to resize the image. We need to put the value true in the dynamicSize variable (in the configuration file). The first parameter is a string, in the example a variable to the image name.

Last updated