vlsoprun / laravel-imgix
该包已废弃且不再维护。未建议替代包。
支持laravel imgix客户端库,用于生成imgix的URL。
1.0.10
2017-01-23 00:35 UTC
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
此仓库将不再支持 😕
安装
使用composer安装此包
composer require vlsoprun/laravel-imgix
更新composer后,将ServiceProvider添加到config/app.php中的providers数组
Laravel 5.x
Vlsoprun\Imgix\ImgixServiceProvider::class,
如果您想使用外观记录消息,请将以下内容添加到app.php中的外观
'Imgix' => Vlsoprun\Imgix\Facades\Imgix::class,
使用发布命令将包配置复制到本地配置
php artisan vendor:publish --provider="Vlsoprun\Imgix\ImgixServiceProvider"
辅助函数
imgix(string $route, $template = 'thumbnail', array $property = []) : string
$route
图片路径
$template
模板参数
$property
额外参数
外观
该方法为图片创建URL。
Imgix::createURL(string $path, $property = [], $default = true) : string
$route
图片路径
$property
额外参数
$default
如果您指定false
,则不使用默认设置
该方法为CSS创建URL。
Imgix::cssURL(string $path, int $colors = 1, string $class = 'image', $property = []) : string
$route
图片路径
$colors
颜色数量
$class
颜色的类名
$property
额外参数
从调色板检索颜色的方法。
Imgix::palette(string $path, int $colors = 1, array $property = [], $toArray = true)
$route
图片路径
$colors
颜色数量
$property
额外参数
$toArray
序列化为数组