PHPackages                             nexwap/upstream - 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. nexwap/upstream

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

nexwap/upstream
===============

A simple composer package for Laravel 8 that assists with file uploads and image resizing/cropping.

v0.6.10(7y ago)09MITPHPPHP &gt;=5.4.0

Since Jul 26Pushed 5y agoCompare

[ Source](https://github.com/jihwan-modoo/Upstream)[ Packagist](https://packagist.org/packages/nexwap/upstream)[ RSS](/packages/nexwap-upstream/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (2)Versions (17)Used By (0)

Upstream
========

[](#upstream)

**A simple composer package for Laravel 5 that assists in file uploads and image resizing/cropping.**

- [Installation](#installation)
- [Uploading Files](#uploading-files)
- [Resizing Images and Creating Thumbnails](#images)

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

[](#installation)

To install Upstream, make sure `regulus/upstream` has been added to Laravel 5's `composer.json` file.

```
"require": {
	"regulus/upstream": "0.6.*"
},

```

Then run `php composer.phar update` from the command line. Composer will install the Upstream package. Now, all you have to do is register the service provider and set up Upstream's alias in `config/app.php`. Add this to the `providers` array:

```
Regulus\Upstream\UpstreamServiceProvider::class,

```

And add this to the `aliases` array:

```
'Upstream' => Regulus\Upstream\Facade::class,

```

Finally, run `php artisan vendor:publish` to publish the config file and language file.

Uploading Files
---------------

[](#uploading-files)

```
$config = [
	'path'            => 'uploads/pdfs', // the path to upload to
	'field'           => 'file',         // name of field (use "fields" for an array with multiple fields)
	'filename'        => 'temp',         // the basename of the file (extension will be added automatically)
	'fileTypes'       => ['png', 'jpg'], // the file types to allow
	'createDirectory' => true,           // automatically creates directory if it doesn't exist
	'overwrite'       => true,           // whether or not to overwrite existing file of the same name
	'maxFileSize'     => '5MB',          // the maximum filesize of file to be uploaded
];

$upstream = Upstream::make($config);
$result   = $upstream->upload();

```

> **Note:** Special `filename` strings are available including `[LOWERCASE]`, `[UNDERSCORED]`, `[LOWERCASE-UNDERSCORED]`, `[DASHED]`, `[LOWERCASE-DASHED]`, and `[RANDOM]`. The former five are used to make formatting adjustments to the original filename. The latter can be used to set the filename to a random string (along with its original extension).

Resizing Images and Creating Thumbnails
---------------------------------------

[](#resizing-images-and-creating-thumbnails)

```
$config = [
	'path'               => 'uploads/images',
	'fields'             => ['picture', 'picture2'],
	'filename'           => 'temp',
	'fileTypes'          => 'images',
	'createDirectory'    => true,
	'overwrite'          => true,
	'maxFileSize'        => '5MB',
	'imageResize'        => true,
	'imageResizeQuality' => 60,
	'imageCrop'          => true,
	'imageDimensions'    => [
		'w'  => 720, // image width
		'h'  => 360, // image height
		'tw' => 180, // thumbnail image width
		'th' => 180, // thumbnail image height
	],
];

$upstream = Upstream::make($config);
$result   = $upstream->upload();

```

An entire set of configuration array is available in the config file at `src/config/config.php`. You may crop images after they have been uploaded with the following:

```
$config = [
	'path'            => 'uploads/images',
	'filename'        => 'temp-'.$id.'.jpg',
	'newFilename'     => $id.'.jpg',
	'createDirectory' => true,
	'overwrite'       => true,
	'imageThumb'      => true,
	'imageDimensions' => [
		'w'  => 260, // image width
		'h'  => 260, // image height
		'tw' => 120, // thumbnail image width
		'th' => 120, // thumbnail image height
	],
	'cropPosition' => [
		'x' => $input['x'],      // X position
		'y' => $input['y'],      // Y position
		'w' => $input['width'],  // width of cropped area
		'h' => $input['height'], // height of cropped area
	],
];

$result = Upstream::cropImage($config);

```

You may use a JavaScript image cropper such as [Cropper](http://fengyuanchen.github.io/cropper) to set the `cropPosition`. If you leave `cropPosition` null or unset, the image will first be scaled to 140% of the target dimensions and then cropped from the center.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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 ~95 days

Recently: every ~114 days

Total

16

Last Release

2882d ago

PHP version history (2 changes)v0.4.0PHP &gt;=5.3.0

v0.4.4PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/01b4a1473214e23eb1f3325389c23e26f43c9d970291f491139cb45bae38a7f8?d=identicon)[Nex.](/maintainers/Nex.)

---

Top Contributors

[![Regulus343](https://avatars.githubusercontent.com/u/967717?v=4)](https://github.com/Regulus343 "Regulus343 (65 commits)")[![Aquanode](https://avatars.githubusercontent.com/u/3297879?v=4)](https://github.com/Aquanode "Aquanode (1 commits)")

### Embed Badge

![Health badge](/badges/nexwap-upstream/health.svg)

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

###  Alternatives

[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)

PHPackages © 2026

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