2017 © Pedro Peláez
 

library nwlaravel-filestorage

FileStorage for the Laravel PHP Framework

image

naturalweb/nwlaravel-filestorage

FileStorage for the Laravel PHP Framework

  • Thursday, October 30, 2014
  • by naturalweb
  • Repository
  • 2 Watchers
  • 3 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

NwLaravel FileStorage

Installation

In the require key of composer.json file add the following, (*1)

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

Run the Composer update comand, (*2)

$ composer update

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

'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, (*4)

'aliases' => array(

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

),

Configuration

Publish config using artisan CLI., (*5)

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:, (*6)

<?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);

The Versions

30/10 2014

dev-master

9999999-dev https://github.com/naturalweb/NwLaravel-FileStorage

FileStorage for the Laravel PHP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel filesystem php s3 dropbox filestorage