orchestra / imagine
Imagine (Wrapper) Component for Laravel
Fund package maintenance!
Liberapay
paypal.me/crynobone
Installs: 175 811
Dependents: 5
Suggesters: 0
Security: 0
Stars: 67
Watchers: 6
Forks: 13
Open Issues: 1
Requires
- php: ^7.3 || ^8.0
- imagine/imagine: ^1.2
- orchestra/support-core: ^6.0
- orchestra/support-providers: ^6.0
Requires (Dev)
- orchestra/testbench: ^6.19
This package is auto-updated.
Last update: 2024-11-18 00:46:22 UTC
README
Imagine (Wrapper) Component is a Laravel package wrapper for Imagine.
Version Compatibility
Installation
To install through composer, run the following command from terminal:
composer require "orchestra/imagine"
Configuration
Add Orchestra\Imagine\ImagineServiceProvider
service provider in config/app.php
.
'providers' => [ // ... Orchestra\Imagine\ImagineServiceProvider::class, ],
Add Imagine
alias in config/app.php
.
'aliases' => [ // ... 'Imagine' => Orchestra\Imagine\Facade::class, ],
Usage
Here a simple example how to create a thumbnail from an image:
<?php use Imagine\Image\ImageInterface; use Orchestra\Imagine\Jobs\CreateThumbnail; dispatch(new CreateThumbnail([ 'path' => $path, 'filename' => $filename, // filename without extension 'extension' => $extension, 'format' => '{filename}.thumb.{extension}', 'dimension' => 320, // width and height will be 320. 'mode' => ImageInterface::THUMBNAIL_OUTBOUND, 'filter' => ImageInterface::FILTER_UNDEFINED, ]));