A Qiniu storage filesystem for Laravel.
lyle-lai/laravel-filesystem-qiniu is a Laravel package for a qiniu storage filesystem for laravel..
It currently has 0 GitHub stars and 25 downloads on Packagist (latest version 0.0.4).
Install it with composer require lyle-lai/laravel-filesystem-qiniu.
Discover more Laravel packages by lyle-lai
or browse all Laravel packages to compare alternatives.
Last updated
Qiniu storage for Laravel based on overtrue/flysystem-qiniu.
$ composer require "overtrue/laravel-filesystem-qiniu" -vvv
Overtrue\LaravelFilesystem\Qiniu\QiniuStorageServiceProvider in your config/app.php file:'providers' => [
// Other service providers...
Overtrue\LaravelFilesystem\Qiniu\QiniuStorageServiceProvider::class,
],
config/filesystems.php config:<?php
return [
//...
'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
],
//...
];
$disk = Storage::disk('qiniu');
// create a file
$disk->put('avatars/1', $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');
MIT