nasyrov / laravel-imgix
Laravel 包,用于生成 Imgix 的 URL。
1.1.0
2020-06-21 13:51 UTC
Requires
- php: >=7.2
- illuminate/support: ^6.0
- imgix/imgix-php: ^3.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-09-21 22:42:36 UTC
README
Laravel 包,用于生成Imgix的 URL。
要求
在继续之前,请确保已安装所有依赖项
安装
首先,通过 Composer 拉取包
$ composer require nasyrov/laravel-imgix
接下来,在 config/app.php
中注册服务提供者
'providers' => [ ... Nasyrov\Laravel\Imgix\ImgixServiceProvider::class, ... ]
可选地,在 config/app.php
中注册外观
'aliases' => [ ... 'Imgix' => Nasyrov\Laravel\Imgix\Facades\Imgix::class, ... ]
最后,发布并更新配置 config/imgix.php
php artisan vendor:publish --tag=imgix
用法
外观
Imgix::createUrl(string $path, array $params = []) : string
$path
图片的路径
$params
图片参数
echo Imgix::createUrl('test.jpg', ['w' => 100, 'h' => 100]); // Prints out: // http://test.imgix.net/test.jpg?w=100&h=100
辅助函数
imgix(string $path, array $params = []) : string
$path
图片的路径
$params
图片参数
echo imgix('test.jpg', ['w' => 100, 'h' => 100]); // Prints out: // http://test.imgix.net/test.jpg?w=100&h=100
测试
$ composer lint
$ composer test
安全性
如果您发现任何与安全相关的问题,请通过inasyrov@ya.ru发送电子邮件,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅许可证文件。