Need help with laravel-filesystem-qiniu?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

overtrue
444 Stars 29 Forks 35 Commits 5 Opened issues

Description

A Qiniu Storage filesystem for Laravel

Services available

!
?

Need anything else?

Contributors list

# 2,582
PHP
wechat
laravel...
Markdow...
16 commits
# 15,356
PHP
wechat
Laravel
CSS
2 commits
# 88,996
PHP
Compose...
packagi...
upyun
1 commit
# 4,204
HTML
Markdow...
wechat
wechat-...
1 commit
# 6,195
PHP
Laravel
HTML
phphub
1 commit
# 275,142
Lua
PHP
qiniu
laravel...
1 commit
# 978
TypeScr...
lesson
elixir-...
Yii Fra...
1 commit

Laravel filesystem Qiniu

Qiniu storage for Laravel based on overtrue/flysystem-qiniu.

Requirement

  • PHP >= 5.5.9

Installation

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

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 <?php

return [ 'disks' => [ //... 'qiniu' => [ 'driver' => 'qiniu', 'accesskey' => env('QINIUACCESSKEY', 'xxxxxxxxxxxxxxxx'), 'secretkey' => env('QINIUSECRETKEY', 'xxxxxxxxxxxxxxxx'), 'bucket' => env('QINIUBUCKET', 'test'), 'domain' => env('QINIUDOMAIN', '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'); $time = $disk->getTimestamp('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->fetch('folder/save_as.txt', $fromUrl);

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

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

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

Full API documentation.

:heart: Sponsor me

If you like the work I do and want to support it, you know what to do :heart:

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

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

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

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.