zhuayi/upload

This package is abandoned and no longer maintained. No replacement package was suggested.

基于laravel的file上传扩展,目前支持七牛云存储

1.1.4 2016-04-20 06:57 UTC

This package is not auto-updated.

Last update: 2018-04-10 17:21:11 UTC


README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Installation

New Project installation

####In order to install Laravel 5 Zhuayi, just add

"zhuayi/upload": "@stable"

to your composer.json. Then run composer install or composer update.

Then in your config/app.php add

Zhuayi\admin\UploadServiceProvider::class

Run Publish

php artisan vendor:publish --force

modify config/upload.php

return [

    'default' => 'local',
    
    'local' => [
        'path' => public_path() . '/uploads',
        'url' => '/uploads',
    ],

    'qiniu' => [
        'accessKey' => accessKey,
        'secretKey' => secretKey,
        'bucket' => bucket,
        'path' => path,
        'url' => url,
    ]
];

##Usage upload file with from

$reset = Zhuayi\upload\upload::file('Filedata');

if (is_null($reset->error)) {

    return $reset->url;

} else {

    return $reset->error;
}

##Usage upload local file to qiniu


$reset = upload::uploadToQiniu(path, newName);
if (is_null($reset->error)) {

    return $reset->url;

} else {

    return $reset->error;
}