Laravel Imgix
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Laravel package for generating URLs with Imgix., (*2)
Requirements
Make sure all dependencies have been installed before moving on:, (*3)
Install
First, pull the package via Composer:, (*4)
``` bash
$ composer require nasyrov/laravel-imgix, (*5)
Next, register the service provider in `config/app.php`:
``` php
'providers' => [
...
Nasyrov\Laravel\Imgix\ImgixServiceProvider::class,
...
]
Optionally register the facade in config/app.php
:, (*6)
``` php
'aliases' => [
...
'Imgix' => Nasyrov\Laravel\Imgix\Facades\Imgix::class,
...
], (*7)
Finally, publish and update the config `config/imgix.php`:
``` bash
php artisan vendor:publish --tag=imgix
Usage
Facade
``` php
Imgix::createUrl(string $path, array $params = []) : string, (*8)
`$path` The path to the image
`$params` The image parameters
``` php
echo Imgix::createUrl('test.jpg', ['w' => 100, 'h' => 100]);
// Prints out:
// http://test.imgix.net/test.jpg?w=100&h=100
Helper
``` php
imgix(string $path, array $params = []) : string, (*9)
`$path` The path to the image
`$params` The image parameters
``` php
echo imgix('test.jpg', ['w' => 100, 'h' => 100]);
// Prints out:
// http://test.imgix.net/test.jpg?w=100&h=100
Testing
bash
$ composer lint
$ composer test
, (*10)
Security
If you discover any security related issues, please email inasyrov@ya.ru instead of using the issue tracker., (*11)
Credits
License
The MIT License (MIT). Please see License File for more information., (*12)