{"id":17359062,"url":"https://github.com/zishang520/huawei-obs-storage","last_synced_at":"2025-03-27T16:17:05.862Z","repository":{"id":191723793,"uuid":"653074712","full_name":"zishang520/huawei-obs-storage","owner":"zishang520","description":"🙃Huawei OBS Laravel storage Filesystem adapter, building the best OBS Storage extension for Laravel.","archived":false,"fork":false,"pushed_at":"2023-08-31T09:44:20.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T12:38:36.916Z","etag":null,"topics":["huwei-obs"],"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/zishang520.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-13T11:05:17.000Z","updated_at":"2023-06-13T11:13:52.000Z","dependencies_parsed_at":"2023-08-31T11:24:25.092Z","dependency_job_id":null,"html_url":"https://github.com/zishang520/huawei-obs-storage","commit_stats":null,"previous_names":["zishang520/huawei-obs-storage"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fhuawei-obs-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fhuawei-obs-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fhuawei-obs-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fhuawei-obs-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zishang520","download_url":"https://codeload.github.com/zishang520/huawei-obs-storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245878924,"owners_count":20687297,"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":["huwei-obs"],"created_at":"2024-10-15T19:07:56.861Z","updated_at":"2025-03-27T16:17:05.839Z","avatar_url":"https://github.com/zishang520.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Huawei-obs-storage for Laravel 9+\n\n## Require\n- Laravel 9+\n- cURL extension\n\n## Installation\nIn order to install HuaweiOBS-storage, just add\n\n    \"luoyy/huawei-obs-storage\": \"^1.0\"\n\nto your composer.json. Then run `composer install` or `composer update`.  \nOr you can simply run below command to install:\n\n    \"composer require luoyy/huawei-obs-storage:^1.0\"\n    \nThen in your `config/app.php` add this line to providers array:\n```php\nluoyy\\HuaweiOBS\\HuaweiObsServiceProvider::class,\n```\n## Configuration\nAdd the following in `app/filesystems.php`:\n```php\n'disks'=\u003e[\n    ...\n    'obs' =\u003e [\n            'driver' =\u003e 'obs',\n            'access_id' =\u003e env('OBS_ACCESS_KEY_ID'),\n            'access_key' =\u003e env('OBS_ACCESS_KEY_SECRET'),\n            'bucket' =\u003e env('OBS_BUCKET'),\n            'endpoint' =\u003e env('OBS_ENDPOINT'), // OBS 外网节点或自定义外部域名\n            'endpoint_internal' =\u003e env('OBS_ENDPOINT_INTERNAL'), // 如果为空，则默认使用 endpoint 配置\n            'cdnDomain' =\u003e env('OBS_DOMAIN'), // 如果不为空，getUrl会判断cdnDomain是否设定来决定返回的url，如果cdnDomain未设置，则使用endpoint来生成url，否则使用cdn\n            'ssl' =\u003e env('OBS_SSL', false), // true to use 'https://' and false to use 'http://'. default is false,\n            'prefix' =\u003e env('OBS_PREFIX'), // 路径前缀\n            'options' =\u003e [],\n            'throw' =\u003e true,\n    ],\n    ...\n]\n```\nThen set the default driver in app/filesystems.php:\n```php\n'default' =\u003e 'obs',\n```\nOk, well! You are finish to configure. Just feel free to use Huawei OBS like Storage!\n\n## Usage\nSee [Larave doc for Storage](https://laravel.com/docs/9.x/filesystem#custom-filesystems)\nOr you can learn here:\n\n\u003e First you must use Storage facade\n\n```php\nuse Illuminate\\Support\\Facades\\Storage;\n```    \n\u003e Then You can use all APIs of laravel Storage\n\n```php\nStorage::disk('obs'); // if default filesystems driver is obs, you can skip this step\n\n//fetch all files of specified bucket(see upond configuration)\nStorage::files($directory);\nStorage::allFiles($directory);\n\nStorage::put('path/to/file/file.jpg', $contents); //first parameter is the target file path, second paramter is file content\nStorage::putFile('path/to/file/file.jpg', 'local/path/to/local_file.jpg'); // upload file from local path\n\nStorage::get('path/to/file/file.jpg'); // get the file object by path\nStorage::exists('path/to/file/file.jpg'); // determine if a given file exists on the storage(OBS)\nStorage::size('path/to/file/file.jpg'); // get the file size (Byte)\nStorage::lastModified('path/to/file/file.jpg'); // get date of last modification\n\nStorage::directories($directory); // Get all of the directories within a given directory\nStorage::allDirectories($directory); // Get all (recursive) of the directories within a given directory\n\nStorage::copy('old/file1.jpg', 'new/file1.jpg');\nStorage::move('old/file1.jpg', 'new/file1.jpg');\nStorage::rename('path/to/file1.jpg', 'path/to/file2.jpg');\n\nStorage::prepend('file.log', 'Prepended Text'); // Prepend to a file.\nStorage::append('file.log', 'Appended Text'); // Append to a file.\n\nStorage::delete('file.jpg');\nStorage::delete(['file1.jpg', 'file2.jpg']);\n\nStorage::makeDirectory($directory); // Create a directory.\nStorage::deleteDirectory($directory); // Recursively delete a directory.It will delete all files within a given directory, SO Use with caution please.\nStorage::url('path/to/img.jpg') // get the file url\nStorage::temporaryUrl('path/to/img.jpg', 900) // Get a temporary URL for the file at the given path.\n```\n\n## Documentation\nMore development detail see [Huawei OBS DOC](https://support.huaweicloud.com/api-obs/obs_04_0079.html)\n## License\nExcept for the Obs directory the source code is released under the MIT license. Read the license file for more information.\nObs is Apache License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fhuawei-obs-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzishang520%2Fhuawei-obs-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fhuawei-obs-storage/lists"}