DIN Image
Instalação usando Composer
"require": {
"dindigital/din-image": "dev-master"
}
Utilizando no Laravel
Editar o arquivo config\app.php
:
Service Providers
Din\DinImage\DinImageServiceProvider::class
Alias
'DinImage' => \Din\DinImage\Facades\DinImage::class
Publicar e editar config config/din-image.php
php artisan vendor:publish
Utilizando
use DinImage;
return $image = DinImage::setWidth(100)
->setHeight(100)
->setCommand('fit')
->setName('Mário')
->setImage('panda.jpg')
->render();
Utilizando Fora do Laravel
//Definindo o padrão
$this->dinImage = new DinImage([
'default_image' => __DIR__ . '/../resources/source/default.png',
'source_folder' => __DIR__ . '/../resources/source/',
'dest_folder' => __DIR__ . '/../resources/dest/',
]);
return $this->dinImage->setWidth(30)
->setHeight(20)
->setCommand('fit')
->setName('Nome da Imagem')
->setImage('nome-da-imagem.jpg')
->render();