PHPackages                             hamidrezaniazi/upolo - 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. hamidrezaniazi/upolo

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

hamidrezaniazi/upolo
====================

Laravel package for uploading files.

3.0.0(4y ago)5561MITPHPPHP ^8.0

Since Jan 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hamidrezaniazi/upolo)[ Packagist](https://packagist.org/packages/hamidrezaniazi/upolo)[ Docs](https://github.com/hamidrezaniazi/upolo)[ RSS](/packages/hamidrezaniazi-upolo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (3)Versions (12)Used By (0)

Upolo - Laravel File Uploader
=============================

[](#upolo---laravel-file-uploader)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ba214cf5c7a287aab85067a4af30c3760fc9b6e0835c6bfbc5754eaeb721fa7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616d696472657a616e69617a692f75706f6c6f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hamidrezaniazi/upolo)[![Build Status](https://camo.githubusercontent.com/dda7d86a653663a5ee17d925855b5108d1bc048022cb422eab96829384128ca8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68616d696472657a616e69617a692f75706f6c6f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/hamidrezaniazi/upolo)[![StyleCI](https://camo.githubusercontent.com/b3de85386c731dc9ca7e9406a221811672415cab90361fe31c975293444ac8d6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231333734353139372f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/213745197)[![Quality Score](https://camo.githubusercontent.com/b91791b3e8fd94e4ce1d93506392f640eae3c064c9306e5e975a48ee560a218a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68616d696472657a616e69617a692f75706f6c6f2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hamidrezaniazi/upolo)[![Total Downloads](https://camo.githubusercontent.com/90a4f8e291a19b73c9cb6ae74c775fe24580d0a7acaf1c8c0048e04cce9df2ad/68747470733a2f2f706f7365722e707567782e6f72672f68616d696472657a616e69617a692f75706f6c6f2f646f776e6c6f616473)](https://packagist.org/packages/hamidrezaniazi/upolo)[![License](https://camo.githubusercontent.com/21587a71c65c5315f09e2734fc1be9547609f5da4fec379596525b4ede49b9ff/68747470733a2f2f706f7365722e707567782e6f72672f68616d696472657a616e69617a692f75706f6c6f2f6c6963656e7365)](https://packagist.org/packages/hamidrezaniazi/upolo)

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

[](#installation)

You can install the package via composer:

```
composer require hamidrezaniazi/upolo
```

You can publish the migration with:

```
php artisan vendor:publish --provider="Hamidrezaniazi\Upolo\UpoloServiceProvider" --tag="migrations"
```

After publishing the migration you can create the files table by running the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

You can persist uploaded files using the facade:

```
$file = Upolo::upload($uploadedFile)
```

If you want to add options in your file model during persisting, use this:

```
$file = Upolo::upload($uploadedFile, $user, $owner, $disk, $flag)
```

**Owner** is related to your file with a polymorphic relation and should implement from **HasFileInterface** and use the trait **HasFileTrait** like this:

```
