PHPackages                             rymanalu/laravel-simple-uploader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. rymanalu/laravel-simple-uploader

ActiveLibrary[File &amp; Storage](/categories/file-storage)

rymanalu/laravel-simple-uploader
================================

Simple file uploader for Laravel 5.

v1.1.1(7y ago)555228MITPHPPHP &gt;=5.5.9

Since Dec 11Pushed 7y ago3 watchersCompare

[ Source](https://github.com/rymanalu/laravel-simple-uploader)[ Packagist](https://packagist.org/packages/rymanalu/laravel-simple-uploader)[ Docs](https://github.com/rymanalu/laravel-simple-uploader)[ RSS](/packages/rymanalu-laravel-simple-uploader/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (5)Versions (11)Used By (0)

Laravel 5 Simple Uploader
=========================

[](#laravel-5-simple-uploader)

[![Build Status](https://camo.githubusercontent.com/845b13338c7c00900676d48c85ed5c702415ee066939bb678b6ee24f0c3cf19f/68747470733a2f2f7472617669732d63692e6f72672f72796d616e616c752f6c61726176656c2d73696d706c652d75706c6f616465722e7376673f6272616e63683d312e30)](https://travis-ci.org/rymanalu/laravel-simple-uploader) [![Total Downloads](https://camo.githubusercontent.com/1fb2bff8e6bc178b107e5371d7c1f5139ccecbf4363f2a5c2093f26adb63a029/68747470733a2f2f706f7365722e707567782e6f72672f72796d616e616c752f6c61726176656c2d73696d706c652d75706c6f616465722f646f776e6c6f616473)](https://packagist.org/packages/rymanalu/laravel-simple-uploader) [![Latest Stable Version](https://camo.githubusercontent.com/65d7bd59f68085865e3fb4e4c09daa1ab242a1d753468045cdcc913631d6cc0f/68747470733a2f2f706f7365722e707567782e6f72672f72796d616e616c752f6c61726176656c2d73696d706c652d75706c6f616465722f762f737461626c65)](https://packagist.org/packages/rymanalu/laravel-simple-uploader) [![License](https://camo.githubusercontent.com/1d062b3962072e0d90728efc752e17d8537055adfd239039dab451a76f1b4f02/68747470733a2f2f706f7365722e707567782e6f72672f72796d616e616c752f6c61726176656c2d73696d706c652d75706c6f616465722f6c6963656e7365)](https://packagist.org/packages/rymanalu/laravel-simple-uploader)

Uploading files and store its in Filesystem / Cloud storage in Laravel 5 is not easy and simple for some developers. This package provides a simple way to do that, and comes with fluent interface that you might like.

Installation
------------

[](#installation)

First, install this package via the Composer package manager:

```
composer require rymanalu/laravel-simple-uploader

```

Next, you should add the `UploaderServiceProvider` to the `providers` array of your `config/app.php` configuration file:

```
Rymanalu\LaravelSimpleUploader\UploaderServiceProvider::class,
```

Don't forget to add the `Uploader` facade to the `aliases` array for shorter code:

```
'Uploader' => Rymanalu\LaravelSimpleUploader\Support\Uploader::class,
```

After that, you should publish the Uploader configuration using the `vendor:publish` Artisan command. This command will publish the `uploader.php` configuration file to your `config` directory:

```
php artisan vendor:publish --provider="Rymanalu\LaravelSimpleUploader\UploaderServiceProvider"

```

Configuration
-------------

[](#configuration)

The Uploader configuration is located at `config/uploader.php`, where you can adjust the default file provider and the default file visibility as you want.

File Providers
--------------

[](#file-providers)

This package comes with two file providers, from HTTP request and local filesystem. Before uploading a file, you can set where the file is provided. Example:

```
Uploader::from('request')->upload('avatar'); // see the supported providers at config/uploader.php

// Or you can use the magic methods...
Uploader::fromRequest()->upload('file');
Uploader::fromLocal()->upload('/path/to/file');
Uploader::fromUrl()->upload('https://via.placeholder.com/150.png');
```

If you call method on the `Uploader` facade without first calling the `from` method, the uploader will assume that you want to use the default provider.

```
// If your default provider is local, it will automatically use the local provider.
Uploader::upload('/path/to/file');
```

Usage
-----

[](#usage)

### Uploading a File

[](#uploading-a-file)

Now, uploading a file is very simple like this:

```
