PHPackages                             teepluss/up2 - 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. teepluss/up2

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

teepluss/up2
============

UP2 is a file uploader with polymorphic relations.

3.0.1(9y ago)127304[1 issues](https://github.com/teepluss/laravel-up2/issues)[1 PRs](https://github.com/teepluss/laravel-up2/pulls)MITPHPPHP &gt;=5.4.0

Since Mar 11Pushed 8y ago2 watchersCompare

[ Source](https://github.com/teepluss/laravel-up2)[ Packagist](https://packagist.org/packages/teepluss/up2)[ Docs](https://github.com/teepluss/laravel-up2)[ RSS](/packages/teepluss-up2/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

Uploader Manager for Laravel
----------------------------

[](#uploader-manager-for-laravel)

### For Laravel 4, please use the [v1.x branch](https://github.com/teepluss/laravel-up2/tree/v1.x)!

[](#for-laravel-4-please-use-the-v1x-branch)

UP2 is a file uploader with polymorphic relations.

### Installation

[](#installation)

- [UP2 on Packagist](https://packagist.org/packages/teepluss/up2)
- [UP2 on GitHub](https://github.com/teepluss/laravel-up2)

To get the lastest version of Theme simply require it in your `composer.json` file.

```
"teepluss/up2": "dev-master"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Once Theme is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => [

    Teepluss\Up2\Up2ServiceProvider::class

]

```

UP2 also ships with a facade which provides the static syntax for creating collections. You can register the facade in the `aliases` key of your `app/config/app.php` file.

```
'aliases' => [

    'UP2' => Teepluss\Up2\Facades\Up2::class

]

```

Publish using artisan CLI.

```
php artisan vendor:publish --provider="Teepluss\Up2\Up2ServiceProvider"

```

Migrate tables.

```
php artisan migrate

```

Usage
-----

[](#usage)

The uploader configuration is located at app/config/up2.php. In this file you may specify which uploader driver you would like used by default throughout your application. UP2 supports Local and S3.

```
'drivers' => array(

    'local' => array(
        'baseUrl' => url(''),
        'baseDir' => path_public(),
    ),

    's3' => array(
        'key'    => '',
        'secret' => '',
        'region' => 'ap-southeast-1',
        'bucket' => 'teeplus',
    ),

),
```

Then you have to create a morph method for your model that want to use "UP2".

```
use Teepluss\Up2\Up2Trait;
use Illuminate\Database\Eloquent\Model;

class Blog extends Model {

    use Up2Trait;

    public function .....

}
```

### Now you able to use "UP2" for uploading file.

[](#now-you-able-to-use-up2-for-uploading-file)

Upload file and resizing.

```
// Return an original file meta.
UP2::upload(Blog::find(1), Input::file('userfile'))->getMasterResult();
UP2::upload(User::find(1), Input::file('userfile'))->getMasterResult();

// Return all results files uploaded including resized.
UP2::upload(Product::find(1), Input::file('userfile'))->resize()->getResults();

// If you have other fields in table attachments.
UP2::upload(User::find(1), Input::file('userfile'), array('some_id' => 999))->getMasterResult();

// UP2 can upload remote file.
UP2::inject(array('remote' => true))->upload(User::find(1), 'http://domain.com/image.png', array('some_id' => 999))->getResults();
```

Upload without model.

```
UP2::upload(null, Input::file('userfile'))->getMasterResult();
```

Inject configuration.

```
UP2::inject(array('subpath' => 'uploads/products'))->upload(Blog::find(1), Input::file('userfile'))->getMasterResult();
```

Look up a file path.

```
$blogs = Blog::with('attachments')->get();

foreach ($blogs as $blog)
{
    foreach ($blog->attachments as $attachment)
    {
        echo UP2::lookup($attachment->id);

        // or lookup with scale from config.
        echo UP2::lookup($attachment->id)->scale('l');
    }
}
```

Remove file(s) from storage.

```
$attachmentId = 'b5540d7e6350589004e02e23feb3dc1f';

// Remove a single file.
UP2::remove($attachmentId);

// Remove all files including resized.
UP2::remove($attachmentId, true);
```

Support or Contact
------------------

[](#support-or-contact)

If you have some problem, Please contact

[![Support via PayPal](https://camo.githubusercontent.com/1c4c2a63b268ab949717893dda9628735444f61b8eb8eece283a534338b5b0e5/68747470733a2f2f7261776769746875622e636f6d2f63687269732d2d2d2f446f6e6174696f6e2d4261646765732f6d61737465722f70617970616c2e6a706567)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9GEC8J7FAG6JA)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~32 days

Total

10

Last Release

3497d ago

Major Versions

1.0.2 → 2.0.02015-10-28

2.1.2 → 3.0.02016-07-28

2.1.3 → 3.0.12016-09-02

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1464300?v=4)[Maximus](/maintainers/teepluss)[@teepluss](https://github.com/teepluss)

---

Top Contributors

[![KousukeKun](https://avatars.githubusercontent.com/u/4623283?v=4)](https://github.com/KousukeKun "KousukeKun (2 commits)")[![buagern](https://avatars.githubusercontent.com/u/294881?v=4)](https://github.com/buagern "buagern (1 commits)")[![ethaizone](https://avatars.githubusercontent.com/u/1168777?v=4)](https://github.com/ethaizone "ethaizone (1 commits)")

---

Tags

laravelresizeupload

### Embed Badge

![Health badge](/badges/teepluss-up2/health.svg)

```
[![Health](https://phpackages.com/badges/teepluss-up2/health.svg)](https://phpackages.com/packages/teepluss-up2)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.1k3.4M81](/packages/unisharp-laravel-filemanager)[itskodinger/midia

Simple Media manager for your Laravel project

1416.0k](/packages/itskodinger-midia)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
