Git Product home page Git Product logo

laravel-aliyun-oss's Introduction

阿里云OSS的Laravel适配

安装

composer require  aoeng/laravel-aliyun-oss

配置文件 config/filesystems.php

[
    'disks' => [
    ...
            'oss' => [
                'driver'       => 'oss',
                'access_id'    => env('ALI_OSS_ACCESS_ID', ''),
                'access_key'   => env('ALI_OSS_ACCESS_KEY', ''),
                'bucket'       => env('ALI_OSS_BUCKET', ''),
                'endpoint'     => env('ALI_OSS_ENDPOINT', ''), // OSS 外网节点或自定义外部域名
                //'endpoint_internal' => '<internal endpoint [OSS内网节点] 如:oss-cn-shenzhen-internal.aliyuncs.com>', // v2.0.4 新增配置属性,如果为空,则默认使用 endpoint 配置(由于内网上传有点小问题未解决,请大家暂时不要使用内网节点上传,正在与阿里技术沟通中)
                'cdnDomain'    => env('ALI_OSS_CDN_DOMAIN', ''), // 如果isCName为true, getUrl会判断cdnDomain是否设定来决定返回的url,如果cdnDomain未设置,则使用endpoint来生成url,否则使用cdn
                'ssl'          => env('ALI_OSS_SSL', false), // true to use 'https://' and false to use 'http://'. default is false,
                'isCName'      => env('ALI_OSS_IS_CNAME', false), // 是否使用自定义域名,true: 则Storage.url()会使用自定义的cdn或域名生成文件url, false: 则使用外部节点生成url
                'debug'        => env('ALI_OSS_DEBUG', false),
                'sts_role_arn' => env('ALI_OSS_STS_ROLE_ARN', ''),//用于创建临时权限
                'prefix'       => env('ALI_OSS_PREFIX', ''),
    
            ],
    ]
 ];

参考

jacobcyl/ali-oss-storage

laravel-aliyun-oss's People

Contributors

aoeng avatar

Watchers

 avatar

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.