New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

teepluss/up

UP is a file uploader with polymorphic relations.
284 20

Larablocks Analysis

teepluss/up works with any PHP project: the latest release (v1.0.0, Aug 28, 2014) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Aug 28, 2014)
  • 0 downloads a month (needs 10,000)
  • 20 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Aug 28, 2014.
  • No releases in the last 12 months.
  • First released: Aug 28, 2014.
  • 2 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require teepluss/up
Latest Version:v1.0.0
PHP:>=5.3.0
License:MIT
Last Updated:Aug 28, 2014
Links: GitHub  ·  Packagist
Maintainer: teepluss

UP is deprecated. Please use the UP2

UP for Laravel 4

UP is a file uploader with polymorphic relations.

Installation

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

"teepluss/up": "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' => array(

    'Teepluss\Up\UpServiceProvider'

)

UP 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' => array(

    'UP' => 'Teepluss\Up\Facades\Up'

)

Publish config using artisan CLI.

php artisan config:publish teepluss/up

Migrate tables.

php artisan migrate --package=teepluss/up

Usage

First you have to create a morph method for your model that want to use "UP".

class Blog extends Eloquent {

    public function .....

    /**
     * Blog has many files upload.
     *
     * @return AttachmentRelate
     */
    public function files()
    {
        return $this->morphMany('\Teepluss\Up\AttachmentRelates\Eloquent\AttachmentRelate', 'fileable');
    }

}

After create a method "files", Blog can use "UP" to upload files.

Upload file and resizing.

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

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

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

// UP can upload remote file. UP::inject(array('remote' => true))->upload(User::find(1), Input::file('userfile'), array('some_id' => 999))->getResults();

Look up a file path.

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

foreach ($blogs as $blog)
{
    foreach ($blog->files as $file)
    {
        // Access attachment.
        // var_dump($file->atatchment);

        echo UP::lookup($file->attachment_id);

        // or lookup with scale from config.

        echo UP::lookup($file->attachment_id)->scale('l');
    }
}

Remove file(s) from storage.

$attachmentId = 'b5540d7e6350589004e02e23feb3dc1f';

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

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

Support or Contact

If you have some problem, Please contact teepluss@gmail.com

Support via PayPal

Alternatives to teepluss/up

webcimes/laravel-mediaforge

Laravel file & image upload service with multi-format processing (resize, conver...

1,244 1
justsmiletoo/laravel-file-compressor

Automatically compress images, PDFs and videos on upload in Laravel. Auto-detect...

1,522 0

Version History

Version Released PHP License
v1.0.0 >=5.3.0 MIT