PHP code example of diedaidai / laravle-bos

1. Go to this page and download the library: Download diedaidai/laravle-bos library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

diedaidai / laravle-bos example snippets


Diedaidai\LaravelBos\BaiduBosFilesystemServiceProvider::class,

	'disks' => [
		...
		'bos' => [
			'driver' => 'bos',
			'bucket' => 'your-bucket-name',
			'options' => [
				'credentials' => [
					'ak' => 'your-ak',
					'sk' => 'your-sk',
				],
				'endpoint' => 'http://su.bcebos.com/upload/',
			],
			'url' => 'http://gkoss01.su.bcebos.com/',
		],
	],

$path = Storage::disk('bos')->putFileAs($folder_name, $file,$filename);//上传
$path = Storage::disk('bos')->url($filename);//获取