Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cos Sdk V5 Laravel Package

qcloud/cos-sdk-v5

Official Tencent Cloud COS SDK for PHP. Provides a simple API for object storage: upload, download, copy, delete, batch operations, bucket and object management, multipart uploads, signatures, and temporary credentials. Composer-friendly and easy to integrate into Laravel/PHP apps.

View on GitHub
Deep Wiki
Context7

cos-php-sdk-v5

Frequently asked questions about Cos Sdk V5
Is qcloud/cos-sdk-v5 a Laravel package, and how do I install it in a Laravel app?
No. It is the official standalone Tencent Cloud COS SDK for PHP, with no service provider, facade, publishable config, or Storage driver. Install it with composer require qcloud/cos-sdk-v5, then bind Qcloud\Cos\Client as a singleton in a service provider and keep application code behind your own ObjectStorage contract. Before committing, verify that Composer resolves the Guzzle 7 build for your PHP version, because the vendor documents separate PHP-version tarballs.
How do I configure Tencent Cloud COS credentials in Laravel?
Create a config/services.php entry for COS using env('COS_REGION'), env('COS_SECRET_ID'), env('COS_SECRET_KEY'), and your bucket, then instantiate Qcloud\Cos\Client with those values. The SDK provides no Laravel config publishing or credential rotation helpers, so secret management, .env handling, and rotation remain your responsibility.
Does qcloud/cos-sdk-v5 support Laravel Storage::disk('cos')?
Not by itself. The SDK is a low-level HTTP client wrapper and does not include a League\Flysystem\FilesystemAdapter or a Laravel filesystem driver. To get Storage::disk('cos')->put(...) ergonomics you must adopt a community COS Flysystem adapter or write a thin adapter yourself.
Which PHP and Guzzle versions does qcloud/cos-sdk-v5 support?
The v2.6.17 notes state that PHP >=5.6 and <7.2.5 uses the Guzzle 6 build (cos-sdk-v5-6.tar.gz), while PHP >=7.2.5 uses the Guzzle 7 build (cos-sdk-v5-7.tar.gz). That puts PHP 8.1, 8.2, and 8.3 with Guzzle 7 on the supported path. The catch is that the vendor documents two tarballs rather than a single Composer constraint, so confirm composer require resolves the correct build on your PHP version.
How do I generate presigned URLs for COS uploads and downloads?
The SDK includes presigned URL support for secure, time-limited upload and download links, alongside request signing for normal API calls. Generate the URL server-side with your credentials and return it to the client; keep expiry short and scope credentials with CAM policies. No Laravel-specific URL helper is provided, so wrap this in your own storage service.
Can qcloud/cos-sdk-v5 handle large file uploads with multipart?
Yes. It supports multipart uploads for efficient transfer of large files using resumable chunks, plus object upload, download, copy, move, and delete operations. In Laravel, run large transfers in queued jobs rather than request/response controllers so retries and long-running chunks do not block web requests.
How should I register the COS client in Laravel's service container?
Bind Qcloud\Cos\Client as a singleton in a service provider and inject it only into an adapter that implements your own ObjectStorage interface. Application code should not reference Qcloud\Cos\Client directly, which keeps the SDK as an infrastructure detail. This also makes it easier to swap in a Flysystem adapter or a fake in tests.
Does qcloud/cos-sdk-v5 support temporary credentials and STS?
Yes. The SDK supports temporary and permanent credentials, and the overview mentions temporary credentials plus CAM-scoped access. Credential lifecycle management, refresh, and rotation are still your responsibility in Laravel, typically via a secret manager and config/services.php. Do not hard-code long-lived keys in application code.
How do I handle retries, timeouts, and COS exceptions in Laravel?
The SDK is built on Guzzle, but its defaults are not Laravel-idiomatic; retries, timeouts, connection pooling, and exception mapping are your responsibility. Configure Guzzle options deliberately in your adapter, map COS errors to your application's exception types, and use Laravel's queue retry/backoff for background transfers. Avoid relying on SDK defaults for production resilience.
Is qcloud/cos-sdk-v5 production-ready, and what are the maintenance risks?
It is the official vendor SDK and covers bucket/object management, multipart uploads, presigned URLs, ACLs, lifecycle, CORS, and tagging, so the API surface is broad. However, adoption is thin at roughly 193 stars and zero dependents, and maintenance is single-vendor with brief Chinese-language changelogs and no migration notes. Before production, verify Composer resolves the correct Guzzle 7 build, pin the version, and wrap the SDK behind your own contract so upgrades and vendor changes are contained.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console