PHPackages                             andrewelkins/cabinet - 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. andrewelkins/cabinet

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

andrewelkins/cabinet
====================

Laravel 4 file upload package.

1.1.4(11y ago)1011.5k26[5 issues](https://github.com/andrewelkins/cabinet/issues)[1 PRs](https://github.com/andrewelkins/cabinet/pulls)MITJavaScriptPHP &gt;=5.3.0

Since Jul 26Pushed 11y ago7 watchersCompare

[ Source](https://github.com/andrewelkins/cabinet)[ Packagist](https://packagist.org/packages/andrewelkins/cabinet)[ RSS](/packages/andrewelkins-cabinet/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (11)Versions (15)Used By (0)

Cabinet - Laravel 4 File Upload Package
=======================================

[](#cabinet---laravel-4-file-upload-package)

Cabinet is a file upload package for Laravel 4.

[![Cabinet Poster](https://camo.githubusercontent.com/54141a10f76c52234c03834a9d7636cef73fd0c9bb75fbc712cfc73fdfd4b487/687474703a2f2f692e696d6775722e636f6d2f793759586556512e706e67)](https://camo.githubusercontent.com/54141a10f76c52234c03834a9d7636cef73fd0c9bb75fbc712cfc73fdfd4b487/687474703a2f2f692e696d6775722e636f6d2f793759586556512e706e67)

Cabinet is a package that allows easy upload of files and images.

Features
--------

[](#features)

- File Upload
- Image Processing for display
- Configurable Image options
- Route, Controller, Model cli generators
- [Configurable](#config)

Quick start
-----------

[](#quick-start)

### Required setup

[](#required-setup)

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

For use with Laravel 4.1.x

```
"andrewelkins/cabinet": "1.0.x"
```

For use with Laravel 4.2.x

```
"andrewelkins/cabinet": "1.1.x"
```

Run the Composer update command

```
$ composer update
```

In your `config/app.php` add `'Andrew13\Cabinet\CabinetServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Andrew13\Cabinet\CabinetServiceProvider',

),
```

At the end of `config/app.php` add `'Cabinet'    => 'Andrew13\Cabinet\CabinetFacade'` to the `$aliases` array

```
'aliases' => array(

    'App'        => 'Illuminate\Support\Facades\App',
    'Artisan'    => 'Illuminate\Support\Facades\Artisan',
    ...
    'Cabinet'    => 'Andrew13\Cabinet\CabinetFacade',

),
```

### Upload model

[](#upload-model)

Now generate the Cabinet migration:

```
$ php artisan cabinet:migration
```

It will generate the `_cabinet_setup_uploads_table.php` migration. You may now run it with the artisan migrate command:

```
$ php artisan migrate
```

It will setup a table containing `filename`, `directory_path`, `extension`, `user_id` and `deleted_at` fields, which are the default fields needed for Cabinet use.

Create an upload model in `app/models/Upload.php`:

```
