承接 otisz/laravel-imgix 相关项目开发

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

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

otisz/laravel-imgix

Composer 安装命令:

composer require otisz/laravel-imgix

包简介

README 文档

README

Latest Stable Version Build Status Total downloads Licence

Laravel package for generating Imgix URLs for your images.

Dependencies

Install

You can install the package via Composer

$ composer require otisz/laravel-imgix

In Laravel 5.5 or above the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

'providers' => [
    ...
    Otisz\Imgix\ImgixServiceProvider::class,
    ...
],

'aliases' => [
    ...
    'Imgix' =>  Otisz\Imgix\Facades\Imgix::class,
    ...
],

You can publish the config file with:

$ php artisan vendor:publish --provider="Otisz\Imgix\ImgixServiceProvider" --tag=config

When published, the config/imgix.php config file contains:

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | ImgIX Domains
    |--------------------------------------------------------------------------
    |
    | Domain sharding enables you to spread image requests across
    | multiple domains. This allows you to bypass the requests-per-host
    | limits of browsers. We recommend 2-3 domain shards maximum if you are
    | going to use domain sharding.
    |
    | @link https://github.com/imgix/imgix-php#domain-sharded-urls
    |
    */
    'domain' => env('IMGIX_DOMAIN', 'example.imgix.net'),

    /*
    |--------------------------------------------------------------------------
    | ImgIX HTTPS
    |--------------------------------------------------------------------------
    |
    | For HTTPS support.
    |
    */
    'useHttps' => env('IMGIX_HTTPS', false),

    /*
    |--------------------------------------------------------------------------
    | ImgIX Signed URLs
    |--------------------------------------------------------------------------
    |
    | To produce a signed URL, you must enable secure URLs on your source
    | and then provide your signature key to the URL builder.
    |
    | @link https://github.com/imgix/imgix-php#signed-urls
    |
    */
    'signKey' => env('IMGIX_SIGNKEY', ''),

    /*
    |--------------------------------------------------------------------------
    | ImgIX Library Param
    |--------------------------------------------------------------------------
    |
    | For security and diagnostic purposes, we default to signing all requests
    | with the language and version of library used to generate the URL.
    |
    */
    'includeLibraryParam' => env('IMGIX_LIBRARY', true),
];

Usage

Read more about srcset.

$path: The path of the image
$params: The parameters provided by Imgix

Facade

\Imgix::createUrl('bridge.png', ['w' => 100, 'h' => 100]);

\Imgix::createSrcSet('bridge.png', ['w' => 100, 'h' => 100]);

Helper

imgix('bridge.png', ['w' => 100, 'h' => 100])

imgixSrcSet('bridge.png', ['w' => 100, 'h' => 100])

Testing

$ composer test

Contributing

Security Vulnerabilities

If you discover any security-related issues, please email leventeotta@gmail.com instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

Licence

The Laravel Imgix package is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固