Giter Site home page Giter Site logo

laravel-flysystem-cos's Introduction

laravel-flysystem-cos

Stable Version Total Downloads License

适用于 Laravel 的腾讯云 COS 适配器,完整支持腾讯云 COS 所有方法和操作。

安装

composer require larva/laravel-flysystem-cos -vv

修改配置文件: config/filesystems.php

添加一个磁盘配置

'cos' => [
    'driver' => 'cos',
    // 'endpoint' => getenv('TENCENT_COS_ENDPOINT'),//接入点,留空即可
    'region' => env('TENCENT_COS_REGION'),
    'credentials' => [//认证凭证
        'appId' => env('TENCENT_COS_APP_ID'),//就是存储桶的后缀 如 1258464748
        'secretId' => env('TENCENT_COS_SECRET_ID'),
        'secretKey' => env('TENCENT_COS_SECRET_KEY'),
        'token' => env('TENCENT_COS_TOKEN'),
    ],
    'bucket' => env('TENCENT_COS_BUCKET'),
    'root' => getenv('COS_PREFIX'),//前缀
    'url'=> env('TENCENT_COS_URL'),//CDN URL 
    //以下均可省略
    'schema' => 'https',
    'timeout' => 3600,
    'connect_timeout' => 3600,
    'ip' => null,
    'port' => null,
    'domain' => null,
    'proxy' => null,
    'encrypt'=> null,
],

修改默认存储驱动

    'default' => 'cos'

使用方法

参见 Laravel wiki

laravel-flysystem-cos's People

Contributors

xutl avatar larvacent avatar

Stargazers

黄一伦 avatar 黄连木笛 avatar chunyang avatar  avatar  avatar

Watchers

James Cloos avatar

Forkers

janhve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.