simonvomeyser/laravel-glide-images
最新稳定版本:0.1.1
Composer 安装命令:
composer require simonvomeyser/laravel-glide-images
包简介
This is my package laravel-glide-images
README 文档
README
⚠️ This is a work-in-progress, the api might change considerably before the first major release.
This package provides a simple glide(url, options) php helper function to generate image urls with Glide on the fly in your templates.
It's aimed for ease of use and simplicity, just install this and use the glide() helper to handle almost anything. This package handles the setup of the endpoint for you.
<!-- will generate an image 500px in width --> <img src="{{ glide('images/image.jpg', 500) }}"> <!-- will generate an 500x500 image in grayscale --> <img src="{{ glide('images/image.jpg', ['w' => 500, 'h'=> 500, 'filt' => 'grayscale']) }}"> <!-- will also work with external urls --> <img src="{{ glide('https://some-domain.com/image.png', 400) }}"> <!-- will also work --> <img src="{{ glide(url('images/image.jpg')) }}">
Installation
You can install the package via composer:
composer require simonvomeyser/laravel-glide-images
You can publish the config file with:
php artisan vendor:publish --tag="glide-images-config"
Usage
The glide() helper allows you to generate URLs for image manipulations on the fly.
External URLs
You can also pass external URLs to the glide() helper. The package will automatically download the remote image, process it, and cache the result. To save disk space, the original remote image is deleted after the manipulated version has been generated and cached.
<img src="{{ glide('https://external-domain.com/photo.jpg', 600) }}">
Testing
wip
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 331
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-27