kvnc/cache-images 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kvnc/cache-images

最新稳定版本:1.0.6-stable

Composer 安装命令:

composer require kvnc/cache-images

包简介

This package adds image cache to laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Introduction

Welcome to my first laravel library

This library has 2 configs which sets original file paths and filters (resizing templates)

     * Mapping key represent where the original image file placed
     * Example you store your blog images into uploads/blogs
     * Then your mapping should be like 'mapping' => [
     *  "blogs" => "uploads/blogs"
     * ]
     * blogs key represent the module parameter of your route , This means when you send blogs module parameter
     *  Library will search under uploads/blogs to find original file
     */
    'mapping' => [

    ],
    /**
     * Filters key represent the resizing width and height of template
     *  such as  'thumb' => ['width' => 100 ,'height' => 100 ]
     */
    'filters' => [

    ]

As you can see above you should set mapping and filters attributes of cache-image config file.

###How to install

composer require kvnc/cache-images

Run this command on your terminal at the root of your laravel project

##Configure To publish config file you should do vendor publish action

     php artisan vendor:publish --provider=Kvnc\CacheImages\CacheImageProvider

Then set config file And set your image file name eg duplicated.jpg to duplicated+jpg and send to route

you can use our helper function to send file on route

function getResizedImageUrl($filter,$module,$image_url): string
{
    $image = implode('+',explode('.',basename($image_url)));
    return route('kvnc_image_cache.cache',['filter'=>$filter,'module' => $module, 'filename'=> $image]);
}

Call getResizedImageUrl in any image tag you need

Have fun Thanks for reading

"Buy Me A Coffee"

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固