PHPackages                             jeremybrammer/laravelimagetos3package - 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. jeremybrammer/laravelimagetos3package

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

jeremybrammer/laravelimagetos3package
=====================================

:package\_description

02PHP

Since Oct 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jeremybrammer/laravelimagetos3package)[ Packagist](https://packagist.org/packages/jeremybrammer/laravelimagetos3package)[ RSS](/packages/jeremybrammer-laravelimagetos3package/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravelimagetos3package
=======================

[](#laravelimagetos3package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a5a07c3ac4d1eb1eae1f576232c2438f86a4ff9e18db9d3b3273aceeb10dbf51/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6572656d796272616d6d65722f6c61726176656c696d616765746f73337061636b6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeremybrammer/laravelimagetos3package)[![Total Downloads](https://camo.githubusercontent.com/ae6d73783c04da1a13e66361897322e8232ed6c224ef6b03d1f369264aabe2b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6572656d796272616d6d65722f6c61726176656c696d616765746f73337061636b6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeremybrammer/laravelimagetos3package)[![Build Status](https://camo.githubusercontent.com/b7b33d991605abce6ce366407d1d160d8ea6676cddf6dfa1c32018f660a1acfc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6572656d796272616d6d65722f6c61726176656c696d616765746f73337061636b6167652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/jeremybrammer/laravelimagetos3package)

A simple Laravel package, to handle image uploads. This package will create a database migration for images, and upload them, resize them, store them on s3, and pre-sign CloudFront URLs!

Links:
======

[](#links)

- Example usage found in this repository:
- The link to the package's GitHub repository:

Installation Steps for this repository:
=======================================

[](#installation-steps-for-this-repository)

Install the composer project:

```
composer install
```

Require the package.

```
composer require jeremybrammer/laravelimagetos3package
```

Publish the package's config files. It publishes a config file for a dependency.

```
php artisan vendor:publish --provider="jeremybrammer\laravelimagetos3package\laravelimagetos3packageServiceProvider"
```

Migrate the database to get the new image uploads database table going.

```
php artisan migrate
```

Change/Add the following lines in the .env file:

```
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=
AWS_URL=
CLOUDFRONT_PRIVATE_KEY_PATH=keys/my_key.pem
CLOUDFRONT_KEY_PAIR_ID=

```

(Add your CloudFront key to /storage/keys/my\_key.pem. This should be .gitignored already).

Depending on your server configuration, increase nginx.conf and php.ini settings as needed to allow larger image uploads, and memory limits.

Package Usage in Controllers:
=============================

[](#package-usage-in-controllers)

Include Laravel's Request class, and the following classes, models, and facades from my package.

```
use Illuminate\Http\Request;
use jeremybrammer\laravelimagetos3package\laravelimagetos3package;
use jeremybrammer\laravelimagetos3package\Models\ImageUpload;
use jeremybrammer\laravelimagetos3package\Facades\LaravelImageToS3PackageFacade;
```

Gets all previously uploaded images and pre-signs the CloudFront URLs for the thumbnails.

```
LaravelImageToS3PackageFacade::getAllUploadedImages();
```

Optionally override the image size settings in the upload service.

```
LaravelImageToS3PackageFacade::setWidthByImageType("thumbnail", 100);
LaravelImageToS3PackageFacade::setWidthByImageType("small", 200);
```

Call the upload handler with the request, html image field name attribute, and folder in s3 to store them.

```
LaravelImageToS3PackageFacade::handUploadRequest($request, "image-upload-field", "victorycto/images");
```

A controller example to view individual images that uses my eloquent model with route-model-binding:

```
public function view(ImageUpload $imageUpload, $imagetype){
    //Use route-model binding for the image object, and an image type to get the proper size.
    switch($imagetype){
        case "thumbnail": $url = $imageUpload->thumbnail_image_url; break;
        case "small": $url = $imageUpload->small_image_url; break;
        case "original": $url = $imageUpload->original_image_url; break;
        default: return; break;
    }
    // $imageURL = $this->imagetos3->preSignS3Url($imageUpload->original_image_url); //Sign s3 URL.
    $imageURL = LaravelImageToS3PackageFacade::preSignCloudFrontUrl($url); //Sign CloudFront URL.
    return view("imageuploads.view", ["imageURL" => $imageURL]);
}
```

Enjoy!

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

- [author name](https://github.com/jeremybrammer)
- [All Contributors](../../contributors)

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14983849?v=4)[Jeremy Brammer](/maintainers/jeremybrammer)[@jeremybrammer](https://github.com/jeremybrammer)

---

Top Contributors

[![jeremybrammer](https://avatars.githubusercontent.com/u/14983849?v=4)](https://github.com/jeremybrammer "jeremybrammer (1 commits)")

### Embed Badge

![Health badge](/badges/jeremybrammer-laravelimagetos3package/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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