PHPackages                             expstudio/laraclip - 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. expstudio/laraclip

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

expstudio/laraclip
==================

Attachment uploader package using Eloquent in Laravel 4 with PHP5.3.x support downgrade from Expstudio/laraclip

1.0.0(11y ago)39911MITPHPPHP &gt;=5.3

Since May 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/expstudio/LaraClip)[ Packagist](https://packagist.org/packages/expstudio/laraclip)[ RSS](/packages/expstudio-laraclip/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (5)Versions (2)Used By (1)

\#LaraClip

Attachment upload package for Laravel 4 with PHP5.3.x support.

Start version - v0.1.0
----------------------

[](#start-version---v010)

- LaraClip 1.0 support Laravel Framework 4.1.\* and backward compatibility with PHP5.3.x.

LaraClip was downgrade from Codesleeve/Stapler by Watee Wichiennit.

- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quickstart)
- [Overview](#overview)
- [Configuration](#configuration)
    - [LaraClip](#laraclip-configuration)
    - [Filesystem](#filesystem-storage-configuration)
    - [S3](#s3-storage-configuration)
- [Interpolations](#interpolations)
- [Image Processing](#image-processing)
- [Examples](#examples)
- [Fetching Remote Images](#fetching-remote-images)
- [Advanced Usage](#advanced-usage)

Requirements
------------

[](#requirements)

LaraClip currently requires php &gt;= 5.3 (LaraClip is take out traits and go back to normal class inheritance).

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

[](#installation)

LaraClip is distributed as a composer package, which is how it should be used in your app.

Install the package using Composer. Edit your project's `composer.json` file to require `expstudio/laraclip`.

```
  "require": {
    "laravel/framework": "4.*",
    "expstudio/laraclip": "dev-master"
  }
```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.

```
    'Expstudio\LaraClip\LaraClipServiceProvider'
```

Warning
-------

[](#warning)

Do not use new PHP5.4+ array syntax (\[\] square bracket). Use old style array ( array() ) instead.

Quickstart
----------

[](#quickstart)

In the document root of your application (most likely the public folder), create a folder named system and grant your application write permissions to it.

In your model:

```
use Expstudio\LaraClip\LaraClip;

class User extends LaraClip {

  public function __construct(array $attributes = array()) {
      $this->hasAttachedFile('image', array(
            'styles' => array(
                          'large' => '450x450#',
                          'thumb' => '100x100#'
                        )
        ));

      parent::__construct($attributes);
  }
}
```

> Make sure that the `hasAttachedFile()` method is called right before `parent::__construct()` of your model.

From the command line, use the migration generator:

```
php artisan laraclip:fasten users avatar
php artisan migrate
```

In your new view:

```
