mscharl / laravel-static-image-cache
此包已被弃用且不再维护。未建议替代包。
将外部图像作为静态文件存储
v1.2
2017-08-31 13:22 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.0.0
- illuminate/console: ^5.0
- illuminate/filesystem: ^5.0
- illuminate/http: ^5.0
- illuminate/routing: ^5.0
- illuminate/support: ^5.0
This package is not auto-updated.
Last update: 2020-01-16 23:27:26 UTC
README
将外部图像作为静态文件存储
配置
将服务提供者添加到 app.php
提供者数组中
[ MScharl\LaravelStaticImageCache\Provider\LaravelStaticImageCacheProvider::class, ]
使用
只需使用 staticImage
助手函数来生成静态文件URL
<img src="{{ staticImage('https://images.domain.com/my-image.jpg') }}" alt="An external image">
清除文件
要手动清除所有文件,可以使用 artisan 任务。
php artisan static-image-cache:clear