2017 © Pedro Peláez
 

library laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

image

overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

  • Sunday, April 29, 2018
  • by overtrue
  • Repository
  • 5 Watchers
  • 273 Stars
  • 19,949 Installations
  • PHP
  • 5 Dependents
  • 3 Suggesters
  • 17 Forks
  • 2 Open issues
  • 7 Versions
  • 21 % Grown

The README.md

Laravel filesystem Qiniu

Qiniu storage for Laravel based on overtrue/flysystem-qiniu., (*1)

Sponsor me, (*2)

Requirement

  • Laravel >= 9.0

Installation

$ composer require "overtrue/laravel-filesystem-qiniu"

Configuration

  1. After installing the library, register the Overtrue\LaravelFilesystem\Qiniu\QiniuStorageServiceProvider in your config/app.php file:
'providers' => [
    // Other service providers...
    Overtrue\LaravelFilesystem\Qiniu\QiniuStorageServiceProvider::class,
],
  1. Add a new disk to your config/filesystems.php config:
<?php

return [
   'disks' => [
        //...
        'qiniu' => [
           'driver'     => 'qiniu',
           'access_key' => env('QINIU_ACCESS_KEY', 'xxxxxxxxxxxxxxxx'),
           'secret_key' => env('QINIU_SECRET_KEY', 'xxxxxxxxxxxxxxxx'),
           'bucket'     => env('QINIU_BUCKET', 'test'),
           'domain'     => env('QINIU_DOMAIN', 'xxx.clouddn.com'), // or host: https://xxxx.clouddn.com
        ],
        //...
    ]
];

Usage

$disk = Storage::disk('qiniu');

// create a file
$disk->put('avatars/filename.jpg', $fileContents);

// check if a file exists
$exists = $disk->has('file.jpg');

// get timestamp
$time = $disk->lastModified('file1.jpg');

// copy a file
$disk->copy('old/file1.jpg', 'new/file1.jpg');

// move a file
$disk->move('old/file1.jpg', 'new/file1.jpg');

// get file contents
$contents = $disk->read('folder/my_file.txt');

// fetch url content
$file = $disk->getAdapter()->fetch('folder/save_as.txt', $fromUrl);

// get file url
$url = $disk->getAdapter()->getUrl('folder/my_file.txt');

// get file upload token
$token = $disk->getAdapter()->getUploadToken('folder/my_file.txt');
$token = $disk->getAdapter()->getUploadToken('folder/my_file.txt', 3600);

// get private url
$url = $disk->getAdapter()->privateDownloadUrl('folder/my_file.txt');

Full API documentation., (*3)

:heart: Sponsor me

Sponsor me, (*4)

如果你喜欢我的项目并想支持它,点击这里 :heart:, (*5)

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects., (*6)

, (*7)

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?, (*8)

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》, (*9)

License

MIT, (*10)

The Versions

29/04 2018

dev-master

9999999-dev

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

29/11 2017

dev-analysis-zGln7l

dev-analysis-zGln7l

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

29/11 2017

1.0.1

1.0.1.0

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

25/08 2017

1.0.0

1.0.0.0

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

03/07 2017

0.0.3

0.0.3.0

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

02/04 2017

0.0.2

0.0.2.0

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

14/03 2017

0.0.1

0.0.1.0

A Qiniu storage filesystem for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar overtrue