vlsoprun / laravel-imgix
Support for laravel imgix client library for generating URLS with imgix.
Requires
- php: >=7.0.0
- illuminate/support: ^5.0,<5.5
- imgix/imgix-php: ^1.1
Requires (Dev)
- guzzlehttp/guzzle: ^6.1
Suggests
- guzzlehttp/guzzle: Will allow more comfortable working with http client
This package is not auto-updated.
Last update: 2017-09-09 08:56:57 UTC
README
This repository will no longer be supported 😕
Installation
Require this package with composer:
composer require vlsoprun/laravel-imgix
After updating composer, add the ServiceProvider to the providers array in config/app.php
Laravel 5.x:
Vlsoprun\Imgix\ImgixServiceProvider::class,
If you want to use the facade to log messages, add this to your facades in app.php:
'Imgix' => Vlsoprun\Imgix\Facades\Imgix::class,
Copy the package config to your local config with the publish command:
php artisan vendor:publish --provider="Vlsoprun\Imgix\ImgixServiceProvider"
Helpers
imgix(string $route, $template = 'thumbnail', array $property = []) : string
$route
The path to the image
$template
Template parameters
$property
Additional parameters
Facade
The method creates a URL for image.
Imgix::createURL(string $path, $property = [], $default = true) : string
$route
The path to the image
$property
Additional parameters
$default
If you specify false
, the default settings will not be used
The method creates a URL for css.
Imgix::cssURL(string $path, int $colors = 1, string $class = 'image', $property = []) : string
$route
The path to the image
$colors
The number of colors
$class
The class name for the color
$property
Additional parameters
Method to retrieve colors from the palette.
Imgix::palette(string $path, int $colors = 1, array $property = [], $toArray = true)
$route
The path to the image
$colors
The number of colors
$property
Additional parameters
$toArray
Serialization to array