{"id":17922700,"url":"https://github.com/overtrue/laravel-filesystem-cos","last_synced_at":"2025-05-16T15:07:20.080Z","repository":{"id":35064725,"uuid":"202510113","full_name":"overtrue/laravel-filesystem-cos","owner":"overtrue","description":"Tencent Cloud COS storage for Laravel based on overtrue/flysystem-cos.","archived":false,"fork":false,"pushed_at":"2025-02-25T14:26:54.000Z","size":43,"stargazers_count":91,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T10:47:25.333Z","etag":null,"topics":["cos","flysystem-adapter","flysystem-qcloud-cos","laravel-filesystem","qcloud-cos","tencent-cloud","tencent-cos"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/overtrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["overtrue"]}},"created_at":"2019-08-15T09:09:11.000Z","updated_at":"2025-04-24T07:47:49.000Z","dependencies_parsed_at":"2024-02-17T06:31:37.762Z","dependency_job_id":"5461ac4d-e4e4-4b65-aa24-03108a5702d1","html_url":"https://github.com/overtrue/laravel-filesystem-cos","commit_stats":{"total_commits":27,"total_committers":5,"mean_commits":5.4,"dds":"0.18518518518518523","last_synced_commit":"73a46723a320d04714e9db3f2c28c88f772e2ece"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-filesystem-cos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-filesystem-cos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-filesystem-cos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-filesystem-cos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtrue","download_url":"https://codeload.github.com/overtrue/laravel-filesystem-cos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cos","flysystem-adapter","flysystem-qcloud-cos","laravel-filesystem","qcloud-cos","tencent-cloud","tencent-cos"],"created_at":"2024-10-28T20:40:29.910Z","updated_at":"2025-05-16T15:07:20.056Z","avatar_url":"https://github.com/overtrue.png","language":"PHP","funding_links":["https://github.com/sponsors/overtrue"],"categories":[],"sub_categories":[],"readme":"# Laravel filesystem COS\n\n![Laravel Octane Ready Status](https://img.shields.io/badge/Octance-ready-green?style=flat-square)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/overtrue/laravel-filesystem-cos?style=flat-square)\n![GitHub License](https://img.shields.io/github/license/overtrue/laravel-filesystem-cos?style=flat-square)\n![Packagist Downloads](https://img.shields.io/packagist/dt/overtrue/laravel-filesystem-cos?style=flat-square)\n\n\n[Tencent Cloud COS](https://cloud.tencent.com/product/cos) storage for Laravel based on [overtrue/flysystem-cos](https://github.com/overtrue/flysystem-cos).\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n# Requirement\n\n-   Laravel \u003e= 9.0\n\n# Installation\n\n```shell\n$ composer require \"overtrue/laravel-filesystem-cos\" -vvv\n```\n\n# Configuration\n\n1. Add a new disk to your `config/filesystems.php` config:\n\n```php\n\u003c?php\n\nreturn [\n   'disks' =\u003e [\n       //...\n       'cos' =\u003e [\n           'driver' =\u003e 'cos',\n\n            'app_id'     =\u003e env('COS_APP_ID'),\n            'secret_id'  =\u003e env('COS_SECRET_ID'),\n            'secret_key' =\u003e env('COS_SECRET_KEY'),\n            'region'     =\u003e env('COS_REGION', 'ap-guangzhou'),\n\n            'bucket'     =\u003e env('COS_BUCKET'),  // 不带数字 app_id 后缀\n           \n            // 可选，如果 bucket 为私有访问请打开此项\n            'signed_url' =\u003e false,\n\n            // 可选，是否使用 https，默认 false\n            'use_https' =\u003e true, \n\n            // 可选，自定义域名\n            'domain' =\u003e 'emample-12340000.cos.test.com', \n\n            // 可选，使用 CDN 域名时指定生成的 URL host\n            'cdn' =\u003e env('COS_CDN'),\n\n            'prefix' =\u003e env('COS_PATH_PREFIX'), // 全局路径前缀\n\n            'guzzle' =\u003e [\n                'timeout' =\u003e env('COS_TIMEOUT', 60),\n                'connect_timeout' =\u003e env('COS_CONNECT_TIMEOUT', 60),\n            ],\n       ],\n       //...\n    ]\n];\n```\n\n\u003e 🚨 请注意：example-1230000001.cos.ap-guangzhou.mycloud.com\n\u003e\n\u003e 其中：**bucket**: example, **app_id**: 1230000001, **region**: ap-guangzhou\n\n# Usage\n\n```php\n$disk = Storage::disk('cos');\n\n// create a file\n$disk-\u003eput('avatars/filename.jpg', $fileContents);\n\n// check if a file exists\n$exists = $disk-\u003ehas('file.jpg');\n\n// get timestamp\n$time = $disk-\u003elastModified('file1.jpg');\n$time = $disk-\u003egetTimestamp('file1.jpg');\n\n// copy a file\n$disk-\u003ecopy('old/file1.jpg', 'new/file1.jpg');\n\n// move a file\n$disk-\u003emove('old/file1.jpg', 'new/file1.jpg');\n\n// get file contents\n$contents = $disk-\u003eread('folder/my_file.txt');\n```\n\n[Full API documentation.](http://flysystem.thephpleague.com/api/)\n\n## :heart: Sponsor me\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n如果你喜欢我的项目并想支持它，[点击这里 :heart:](https://github.com/sponsors/overtrue)\n\n## Project supported by JetBrains\n\nMany thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.\n\n[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/overtrue)\n\n## PHP 扩展包开发\n\n\u003e 想知道如何从零开始构建 PHP 扩展包？\n\u003e\n\u003e 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-filesystem-cos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertrue%2Flaravel-filesystem-cos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-filesystem-cos/lists"}