naturalweb/nwlaravel-filestorage 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

naturalweb/nwlaravel-filestorage

Composer 安装命令:

composer require naturalweb/nwlaravel-filestorage

包简介

FileStorage for the Laravel PHP Framework

README 文档

README

Installation

In the require key of composer.json file add the following

"naturalweb/nwlaravel-filestorage": "~0.1"

Run the Composer update comand

$ composer update

In your config/app.php add 'NwLaravel\FileStorage\FileStorageServiceProvider' to the end of the $providers array

'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'NwLaravel\FileStorage\FileStorageServiceProvider',

),

At the end of config/app.php add 'FileStorage' => 'NwLaravel\FileStorage\FileStorageFacade' to the $aliases array

'aliases' => array(

    'App'        => 'Illuminate\Support\Facades\App',
    'Artisan'    => 'Illuminate\Support\Facades\Artisan',
    ...
    'FileStorage'    => 'NwLaravel\FileStorageFacade',

),

Configuration

Publish config using artisan CLI.

php artisan config:publish naturalweb/nwlaravel-filestorage

The configuration to app/config/packages/naturalweb/nwlaravel-filestorage/config/filestorage.php. This file will look somewhat like:

<?php

/*
|--------------------------------------------------------------------------
| Configuration FileStorage
|--------------------------------------------------------------------------
*/

return array(

    'default'  => 'filesystem',

    'path_tmp'  => sys_get_temp_dir(),
    
    'storages'  => array(

        'filesystem' => array(
            'root' => public_path('/uploads'),
            'host' => url('uploads'),
        ),

        's3' => array(
            'root'    => '/bucket',
            'access'  => 'your-access',
            'secret'  => 'your-secret',
        ), 

        'dropbox' => array(
            'root'   => '/folder',
            'token'  => 'your-token',
            'app'    => 'your-app',
        ),
    ),
);

Usage

$name = 'name-file.txt';
$source = '/source/path/file.txt';
$folder = '/folder/destino';
$override = true;
$bool = FileStorage::save($name, $source, $folder, $override);

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固