承接 jakobid/cdn-image 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jakobid/cdn-image

最新稳定版本:v1.0.2

Composer 安装命令:

composer require jakobid/cdn-image

包简介

Using cdn for images on the website

README 文档

README

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

If your website is running and has lots of images which make it slow, you should start to use a CDN for better speed beside with some convenient operations to manipulate image like resize, filter, convert to webp, etc...

By default, this package supports statically (a free CDN service out of the box) using via /img endpoint.

Installation

You can install the package via composer:

composer require bangnokia/cdn-image

You can publish the config file with:

php artisan vendor:publish --provider="BangNokia\CdnImage\CdnImageServiceProvider" --tag="cdn-image-config"

Sample config file

<?php

return [
    'default' => 'statically',

    'services' => [
        'statically' => [
            'domain' => 'cdn.statically.io'
        ],

        'cloud_image' => [
            'domain'  => 'cloudimg.io',
            'token'   => env('CLOUD_IMAGE_TOKEN'),
            'version' => env('CLOUD_IMAGE_VERSION', 'v7')
        ]
    ]
];

Now you should value for the provider you are using in config/cdn_image.php config file.

CDN Providers supported

Usage

The blade x-img component supports 3 most used props (at least I thought that):

  • src
  • width
  • height

and

  • query for other operations which depends on each provider

Example

<x-img src="http://foo.bar/demo.jpg" width="200" height="100" :query="['q' => 90']" />

will be rendered to

<img src="htts://statically.io/img/foo.bar/demo.jpg?w=200&h=100&q=90" >

Testing

composer test

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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固