hinet/laravel-baidu-bos

A Flysystem Baidu Bos Wrapper for Laravel
214
Install
composer require hinet/laravel-baidu-bos
PHP:>=5.4.0
License:MIT
Last Updated:Apr 14, 2021
Links: GitHub  ·  Packagist
Maintainer: hinet

laravel-baidu-bos

Laravel百度云文件存储引擎

Author Software License Packagist Version Total Downloads

Installation

composer require "hinet/laravel-baidu-bos": "~1.0"

or add the following line to your project's composer.json:

"require": {
   "hinet/laravel-baidu-bos": "~1.0"
}

then

composer update

After completion of the above, add the following line to the section providers of config/app.php:

Hinet\Baidu\BaiduServiceProvider::class,

Configuration

Edit config\filesystems.php: Add bos disk

	'disks' => [

		'local' => [
			'driver' => 'local',
			'root'   => storage_path().'/app',
		],

		's3' => [
			'driver' => 's3',
			'key'    => 'your-key',
			'secret' => 'your-secret',
			'region' => 'your-region',
			'bucket' => 'your-bucket',
		],

		'rackspace' => [
			'driver'    => 'rackspace',
			'username'  => 'your-username',
			'key'       => 'your-key',
			'container' => 'your-container',
			'endpoint'  => 'https://identity.api.rackspacecloud.com/v2.0/',
			'region'    => 'IAD',
			'url_type'  => 'publicURL'
		],

		'bos' => [
			'driver' => 'bos',
			'bucket' => 'your-bucket-name',
			'options' => [
				'credentials' => [
					'ak' => 'your-ak',
					'sk' => 'your-sk',
				],
				'endpoint' => 'http://bj.bcebos.com',
			]
		],
	],

Usage

$exists = Storage::disk('bos')->exists('path/to/file');
$content = Storage::disk('bos')->get('path/to/file');

Official Documentation

Documentation for laravel framework 'Filesystem/Cloud Storage' can be found on the Laravel website.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

404,034,618 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

384,821,166 4,658