LaravelPackages.net
Acme Inc.
Toggle sidebar
larva/laravel-flysystem-cos

This is a Flysystem adapter for the Tencent COS.

2.435
6
2.0.4
About larva/laravel-flysystem-cos

larva/laravel-flysystem-cos is a Laravel package for this is a flysystem adapter for the tencent cos.. It currently has 6 GitHub stars and 2.435 downloads on Packagist (latest version 2.0.4). Install it with composer require larva/laravel-flysystem-cos. Discover more Laravel packages by larva or browse all Laravel packages to compare alternatives.

Last updated

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

Star History Chart