PHPackages                             nodes/assets - 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. nodes/assets

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

nodes/assets
============

Package to make upload and generation of urls matching the files

1.1.21(6y ago)311.2k4[3 issues](https://github.com/nodes-php/nodes-php-assets/issues)1MITPHP

Since Nov 13Pushed 6y ago2 watchersCompare

[ Source](https://github.com/nodes-php/nodes-php-assets)[ Packagist](https://packagist.org/packages/nodes/assets)[ RSS](/packages/nodes-assets/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (8)Versions (41)Used By (1)

Assets
------

[](#assets)

A easy integration for handling files with [Laravel](http://laravel.com/docs).

[![Total downloads](https://camo.githubusercontent.com/837dd443f62d6271520ee9dbf99ea50810d09d36787fb2b90d497df24fcaf994/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f6465732f6173736574732e737667)](https://packagist.org/packages/nodes/assets)[![Monthly downloads](https://camo.githubusercontent.com/b8e892ddfaf0616cc8212fac49a6aa11440076afd886847bb3898d1e7c9a0e11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e6f6465732f6173736574732e737667)](https://packagist.org/packages/nodes/assets)[![Latest release](https://camo.githubusercontent.com/cd1762f8453448208e478b0ece0597beac9c46bcdf28c63a52c5f10a954208d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f6465732f6173736574732e737667)](https://packagist.org/packages/nodes/assets)[![Open issues](https://camo.githubusercontent.com/0c5b4ff3b048147fa53594ed3ad616cf9e56f7d76eadb3304b821a255eaf76ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6e6f6465732d7068702f6173736574732e737667)](https://github.com/nodes-php/assets/issues)[![License](https://camo.githubusercontent.com/c67f6119493f953c37e803623b7412efd3513a506c0d6a931e259e5eed3eea89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f6465732f6173736574732e737667)](https://packagist.org/packages/nodes/assets)[![Star repository on GitHub](https://camo.githubusercontent.com/bf54b48c234da16fc0071b7c973e89eb1b35b53a88ba571c302524466776e5f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f6465732d7068702f6173736574732e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nodes-php/assets/stargazers)[![Watch repository on GitHub](https://camo.githubusercontent.com/c960bab74c07377a97aa47ca290827ad61dbeab0f38df0631ce85e5bd70575f9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6e6f6465732d7068702f6173736574732e7376673f7374796c653d736f6369616c266c6162656c3d5761746368)](https://github.com/nodes-php/assets/watchers)[![Fork repository on GitHub](https://camo.githubusercontent.com/7f1cd3db4f0e591295d059d5458590a879201631c8c2bde5e5cdcce1950cd8c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6e6f6465732d7068702f6173736574732e7376673f7374796c653d736f6369616c266c6162656c3d466f726b)](https://github.com/nodes-php/assets/network)[![Travis tests](https://camo.githubusercontent.com/42f4089624e47d777a24fda934f34688d518cb74baed160d4bab71cd62e2ff35/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6f6465732d7068702f6173736574732e737667)](https://travis-ci.org/nodes-php/assets)[![StyleCI](https://camo.githubusercontent.com/29c421ac7ce88a0845265e2c429e816a3ceb955f4e1b0672fab02b35814690e7/68747470733a2f2f7374796c6563692e696f2f7265706f732f34353738363038372f736869656c64)](https://styleci.io/repos/45786087)[![Code Climate](https://camo.githubusercontent.com/e20338f87843d084ce2382286cf2cbc39ec5be21beb46565064be2e9d36f66fa/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6f6465732d7068702f6173736574732f6261646765732f6770612e737667)](https://codeclimate.com/github/nodes-php/assets)

📝 Introduction
--------------

[](#-introduction)

One thing we at [Nodes](http://nodesagency.com) have been missing in [Laravel](http://laravel.com/docs) is a fast easy file storage integration system.

The `Storage` facade made it easier, but we still need the option to upload from differente formats and store to a very specific folder structure, retrieve a path and be able to create urls to serve api and sites.

📦 Installation
--------------

[](#-installation)

To install this package you will need:

- Laravel 5.1+
- PHP 5.5.9+

You must then modify your `composer.json` file and run `composer update` to include the latest version of the package in your project.

```
"require": {
    "nodes/assets": "^1.1"
}
```

Or you can run the composer require command from your terminal.

```
composer require nodes/assets:^1.1
```

🔧 Setup
-------

[](#-setup)

Setup service provider in `config/app.php`

```
Nodes\Assets\ServiceProvider::class
```

Setup alias in `config/app.php`

```
'Assets' => Nodes\Assets\Support\Facades\Assets::class
```

Publish config files

```
php artisan vendor:publish --provider="Nodes\Assets\ServiceProvider"
```

If you want to overwrite any existing config files use the `--force` parameter

```
php artisan vendor:publish --provider="Nodes\Assets\ServiceProvider" --force
```

### S3 + ImgIX

[](#s3--imgix)

In general.php config

```
'upload' => [
        'provider' => function () {
            $s3Config = config('filesystems.disks.s3');
            $awsS3Config = config('nodes.assets.provider.aws-s3');
            return new \Nodes\Assets\Upload\Providers\AmazonS3($awsS3Config, $s3Config);
        },
    ],
    'url'    => [
        'provider' => function () {
            $imgIxConfig = config('nodes.assets.providers.imgix');

            return new \Nodes\Assets\Url\Providers\ImgIX($imgIxConfig);
        },
    ],
```

Make sure to have .env setup

```
AMAZON_BUCKET=bucket
AMAZON_KEY=key
AMAZON_SECRET=secret
AMAZON_REGION=eu-west-1
CDN_BASE_URL=nodes-cdn-development.imgix.net

```

### Vapor Cloud

[](#vapor-cloud)

In general.php config

```
