Skip to content

orchestral/imagine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8814ff1 · Feb 21, 2019
Feb 13, 2019
Feb 21, 2019
Feb 21, 2019
Feb 8, 2018
Sep 18, 2013
Sep 3, 2017
Sep 13, 2018
Oct 14, 2017
Jun 16, 2016
Feb 13, 2019
Feb 21, 2019
Feb 5, 2015
Sep 13, 2018
Jan 16, 2019
Sep 13, 2018

Repository files navigation

Imagine (Wrapper) Component for Laravel 5

Imagine (Wrapper) Component is a Laravel 5 package wrapper for Imagine.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Table of Content

Version Compatibility

Laravel Imagine
4.x.x 2.x.x
5.0.x 3.0.x
5.1.x 3.1.x
5.2.x 3.2.x
5.3.x 3.3.x
5.4.x 3.4.x
5.5.x 3.5.x
5.6.x 3.6.x
5.7.x 3.7.x

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "orchestra/imagine": "^3.0"
    }
}

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require "orchestra/imagine=^3.0"

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,
]));