PHPackages                             xinningsu/laravel-filesystem-baidu-bos - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. xinningsu/laravel-filesystem-baidu-bos

ActiveLibrary[File &amp; Storage](/categories/file-storage)

xinningsu/laravel-filesystem-baidu-bos
======================================

Baidu BOS storage for Laravel, 百度对象存储作为Laravel文件存储。

v1.0.2(1y ago)01.6kMITPHPPHP &gt;=8.0

Since Mar 5Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/xinningsu/laravel-filesystem-baidu-bos)[ Packagist](https://packagist.org/packages/xinningsu/laravel-filesystem-baidu-bos)[ Docs](https://github.com/xinningsu/laravel-filesystem-baidu-bos)[ RSS](/packages/xinningsu-laravel-filesystem-baidu-bos/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Laravel Filesystem Baidu BOS
============================

[](#laravel-filesystem-baidu-bos)

Baidu BOS storage for Laravel, 百度对象存储作为Laravel文件存储。

[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)[![Build Status](https://camo.githubusercontent.com/360e2aaf79f4dc571e55f4b1b3854e6d12b20d59e0d14a0b31689a853262903b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f78696e6e696e6773752f6c61726176656c2d66696c6573797374656d2d62616964752d626f732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xinningsu/laravel-filesystem-baidu-bos/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/b7e616de911818e7747e96ee69ee80b9cdfd701595912bad06321aeed56b4069/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f78696e6e696e6773752f6c61726176656c2d66696c6573797374656d2d62616964752d626f732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xinningsu/laravel-filesystem-baidu-bos/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4ce05c73af131d9d562e10ae6a2ed1f4337c31147046fcc8e078d996c7670856/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f78696e6e696e6773752f6c61726176656c2d66696c6573797374656d2d62616964752d626f732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xinningsu/laravel-filesystem-baidu-bos)[![Code Intelligence Status](https://camo.githubusercontent.com/95440f5991b1939fa29299b96ea24e52a49bf9e6619144429e59a907806f8bd2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f78696e6e696e6773752f6c61726176656c2d66696c6573797374656d2d62616964752d626f732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/g/xinningsu/laravel-filesystem-baidu-bos)[![Maintainability](https://camo.githubusercontent.com/5e250fb9fe6067ecf0ba74b019c758ce77c027748d1084a00f0cf09412713b67/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61353632323562616539326165333333366564662f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/xinningsu/laravel-filesystem-baidu-bos/maintainability)

Installation
============

[](#installation)

```
composer require xinningsu/laravel-filesystem-baidu-bos

```

Discovery
---------

[](#discovery)

- For Laravel &gt;= 5.5, It uses package auto discovery feature, no need to add service provider.
- For Laravel &lt; 5.5, add `Sulao\LaravelFilesystem\BaiduBos\BaiduBosServiceProvider::class` to `config/app.php` under `providers` element.

```
return [
    // ...
    'providers' => [
        // ...
        /*
         * Package Service Providers...
         */
        Sulao\LaravelFilesystem\BaiduBos\BaiduBosServiceProvider::class,
    ],
    // ...
];
```

Configuration
-------------

[](#configuration)

Set up bos credentials in .env, then add new disk in `config/filesystems.php`:

```
return [
    // ...
    'disks' => [
        // ...
        'bos' => [
            'driver' => 'bos',
            'access_key' => env('BOS_KEY'),
            'secret_key' => env('BOS_SECRET'),
            'region' => env('BOS_REGION'), // gz, bj ...
            'bucket' => env('BOS_BUCKET'),
        ],
        // ...
    ],
    // ...
];
```

Examples
========

[](#examples)

```
$disk = \Illuminate\Support\Facades\Storage::disk('bos');

// Determine if a file exists.
$disk->exists('file.txt');

// Get the contents of a file.
$content = $disk->get('file.txt');

// Get a resource to read the file.
$stream = $disk->readStream('file.txt');

// Write the contents of a file.
$disk->put('file.txt', 'contents');

// Write a new file using a stream.
$disk->writeStream('file.txt', fopen('/resource.txt', 'r'));

// Get the visibility for the given path.
$visibility = $disk->getVisibility('file.txt');

// Set the visibility for the given path.
$disk->setVisibility('file.txt', 'public');

// Prepend to a file.
$disk->prepend('file.txt', 'prepend contents');

// Append to a file.
$disk->append('file.txt', 'append contents');

// Delete the file(s) at a given path.
$disk->delete('file.txt');
$disk->delete(['file.txt', 'file2.txt']);

// Copy a file to a new location.
$disk->copy('file.txt', 'new_file.txt');

// Move a file to a new location.
$disk->move('file.txt', 'new_file.txt');

// Get the file size of a given file.
$size = $disk->size('file.txt');

// Get the file's last modification time.
$ts = $disk->lastModified('file.txt');

// Get an array of all files in a directory.
$files = $disk->files($directory = 'test/', $recursive = false);

// Get all of the files from the given directory (recursive).
$allFiles = $disk->allFiles($directory = null);

// Get all of the directories within a given directory.
$dirs = $disk->directories($directory = null, $recursive = false);

// Get all (recursive) of the directories within a given directory.
$allDirs = $disk->allDirectories($directory = null);

// Create a directory.
$disk->makeDirectory('test/');

// Delete a directory.
$disk->deleteDirectory('test/');
```

Reference
=========

[](#reference)

-
-
-
-
-

License
=======

[](#license)

[MIT](./LICENSE)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~592 days

Total

3

Last Release

710d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.6

v1.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7513c529acb322b54c46bef8011275fe734f9d00944c3f3921cebc21c0cd2ed0?d=identicon)[xinningsu](/maintainers/xinningsu)

---

Top Contributors

[![xinningsu](https://avatars.githubusercontent.com/u/7017728?v=4)](https://github.com/xinningsu "xinningsu (4 commits)")

---

Tags

baidu-bosbaidu-bos-adapterlaravel-filesystemlaravel-filesystem-baidu-boslaravel-storagelaravel-storage-baidu-bosfilesystemlaravellaravel-filesystemlaravel-storagebosbaidubaidu bosbaidu object storagefilesystem baidu bos

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/xinningsu-laravel-filesystem-baidu-bos/health.svg)

```
[![Health](https://phpackages.com/badges/xinningsu-laravel-filesystem-baidu-bos/health.svg)](https://phpackages.com/packages/xinningsu-laravel-filesystem-baidu-bos)
```

###  Alternatives

[singlequote/laravel-webdav

1344.8k](/packages/singlequote-laravel-webdav)[yoelpc4/laravel-cloudinary

Laravel Cloudinary filesystem cloud driver.

3343.0k](/packages/yoelpc4-laravel-cloudinary)[bringyourownideas/laravel-backblaze

Backblaze B2 Cloud Storage for Laravel 5. Original by Paul Olthof (@hpolthof) continued by @bringyourownideas

1237.8k](/packages/bringyourownideas-laravel-backblaze)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
