2017 © Pedro Peláez
 

library laravel-storage

A simple storage filesystem package for Laravel 4.

image

dmyers/laravel-storage

A simple storage filesystem package for Laravel 4.

  • Monday, March 14, 2016
  • by dmyers
  • Repository
  • 10 Watchers
  • 102 Stars
  • 4,765 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 2 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

Storage Package for Laravel 4

Storage is a filesystem abstraction layer for Laravel 4 applications. If you are using Laravel 5 it comes with a similar package included which can be found in the docs., (*1)

Installation via Composer

Add this to you composer.json file, in the require object:, (*2)

"dmyers/laravel-storage": "1.*"

After that, run composer install to install Storage., (*3)

Add the service provider to app/config/app.php, within the providers array., (*4)

'providers' => array(
    // ...
    'Dmyers\Storage\StorageServiceProvider',
)

Add a class alias to app/config/app.php, within the aliases array., (*5)

'aliases' => array(
    // ...
    'Storage' => 'Dmyers\Storage\Storage',
)

Finally, ensure the files directory defined in the config file is created and writable by the web server (defaults to public/files)., (*6)

$ mkdir public/files
$ chmod -R 777 public/files

Configuration

Publish the default config file to your application so you can make modifications., (*7)

$ php artisan config:publish dmyers/laravel-storage

Usage

Check if a file exists in storage:, (*8)

Storage::exists('user/avatar.jpg');

Get a file's contents from storage:, (*9)

Storage::get('user/avatar.jpg');

Put a file into storage:, (*10)

Storage::put('user/avatar.jpg', $contents);

Upload a file into storage:, (*11)

Storage::upload(Input::file('avatar'), 'user/avatar.jpg');

Upload a remote file into storage:, (*12)

Storage::remoteUpload('http://laravel.com/favicon.ico', 'user/avatar.jpg');

Download a file from storage:, (*13)

Storage::download('user/avatar.jpg', 'tmp/images/user-1/avatar.jpg');

Download a remote file locally:, (*14)

Storage::remoteDownload('http://laravel.com/favicon.ico', 'tmp/images/user-1/avatar.jpg');

Delete a file from storage:, (*15)

Storage::delete('user/avatar.jpg');

Move a file in storage:, (*16)

Storage::move('user/avatar.jpg', 'user/1/avatar.jpg');

Copy a file in storage:, (*17)

Storage::copy('user/avatar.jpg', 'user/avatar.bak.jpg');

Get a file's type from storage:, (*18)

Storage::type('user/avatar.jpg');

Get a file's mime type from storage:, (*19)

Storage::mime('user/avatar.jpg');

Get a file's size from storage:, (*20)

Storage::size('user/avatar.jpg');

Get a file's last modification date from storage:, (*21)

Storage::lastModified('user/avatar.jpg');

Check if a path is a directory in storage:, (*22)

Storage::isDirectory('user/avatar.jpg');

List all files in storage:, (*23)

Storage::files('images');

Get the full URL to a file in storage:, (*24)

Storage::url('user/avatar.jpg');

Render a file from storage to the browser:, (*25)

Storage::render('user/avatar.jpg');

The Versions

14/03 2016

dev-master

9999999-dev

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel filesystem storage

14/03 2016

v1.0.10

1.0.10.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel filesystem storage

06/09 2014

v1.0.9

1.0.9.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

05/08 2014

v1.0.8

1.0.8.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

28/05 2014

v1.0.7

1.0.7.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

08/05 2014

v1.0.6

1.0.6.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

08/05 2014

v1.0.5

1.0.5.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

06/05 2014

v1.0.4

1.0.4.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

06/05 2014

v1.0.3

1.0.3.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

06/05 2014

v1.0.2

1.0.2.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

11/03 2014

v1.0.1

1.0.1.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage

05/03 2014

v1.0.0

1.0.0.0

A simple storage filesystem package for Laravel 4.

  Sources   Download

MIT

The Requires

 

laravel filesystem storage