2017 © Pedro Peláez
 

library imaginator

Image processor and provider

image

hubertnnn/imaginator

Image processor and provider

  • Monday, May 7, 2018
  • by hubertnnn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 117 % Grown

The README.md

Imaginator

This package is not finished yet

This package adds an easy to use and secure way of providing scaled images., (*1)

Current version can only be used with laravel, but there are plans to make it framework agnostic in the future., (*2)

Installation

Install using composer:, (*3)

composer require hubertnnn/imaginator

Then publish laravel config file:, (*4)

php artisan vendor:publish --provider="HubertNNN\Imaginator\Integration\Laravel\ImaginatorServiceProvider" --tag="config"

For laravel versions below 5.5 you need to register the provider and facade. To do so add the ServiceProvider to the providers array in config/app.php:, (*5)

HubertNNN\Imaginator\Integration\Laravel\ImaginatorServiceProvider::class,

and Facade to the facades array in the same file, (*6)

'Imaginator' => HubertNNN\Imaginator\Integration\Laravel\ImaginatorFacade::class,

Configuration

All configuration is done using config/imaginator.php file. Each option is documented inside the file., (*7)

Basic configuration requires you to setup providers and formats. The default file contains example configuration., (*8)

Usage

You can create an image link using following commands:, (*9)

Imaginator::entity($entity, $format, $optionalEntityType);
Imaginator::image($type, $instance, $format);

For example:, (*10)

$user = User::first();
echo Imaginator::entity($user, '800x600');

If single entity provides more than 1 image (eg. user can have an avatar and a picture), you can use the optional parameter to choose what image are you interested in. Here is an example of usage in blade view., (*11)

<img src="{{ Imaginator::entity($user, '800x600', 'avatar') }}">

The Versions

07/05 2018

dev-master

9999999-dev

Image processor and provider

  Sources   Download

MIT

The Requires

 

by Hubert Narożny

07/05 2018

0.2.0

0.2.0.0

Image processor and provider

  Sources   Download

MIT

The Requires

 

by Hubert Narożny

07/05 2018

dev-develop

dev-develop

Image processor and provider

  Sources   Download

MIT

The Requires

 

by Hubert Narożny

07/05 2018

0.1.0

0.1.0.0

Image processor and provider

  Sources   Download

MIT

The Requires

 

by Hubert Narożny