PHPackages                             stianscholtz/s3-direct-uploader - 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. stianscholtz/s3-direct-uploader

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

stianscholtz/s3-direct-uploader
===============================

A headless Laravel file uploader to upload files to s3 directly from the client.

0.0.7(1y ago)048MITPHPPHP &gt;=8.0

Since Apr 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stian-scholtz/s3-direct-uploader)[ Packagist](https://packagist.org/packages/stianscholtz/s3-direct-uploader)[ Docs](https://github.com/stian-scholtz/s3-direct-uploader)[ RSS](/packages/stianscholtz-s3-direct-uploader/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

S3DirectUploader Laravel Package
================================

[](#s3directuploader-laravel-package)

S3DirectUploader is a headless Laravel package designed to facilitate direct file uploads to Amazon S3 from the client/browser. Please note that users need to build their own File Input, although a complimentary component will be available in the near future. This package then handles the uploaded files, creates corresponding file records in your database, and offers various features such as automatic thumbnail generation, image resizing and scaling, MIME type restrictions, and more.

Features
--------

[](#features)

- Direct file uploads to Amazon S3 from the client/browser.
- Creation of file records in the database.
- Laravel auto-discovery support.
- S3DirectUploader Facade.
- Config file with sensible defaults.
- Route macro for convenience.
- Automatic thumbnail generation (can be disabled).
- Image resizing and scaling options.
- MIME type restrictions.
- File size restriction.
- Prefixing file names.
- Configurable disk via config/filesystems.php.

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

[](#installation)

You can install the S3DirectUploader package via Composer. Run the following command:

```
composer require stianscholtz/s3-direct-uploader
```

The package will automatically register its service provider and Facade.

Configuration
-------------

[](#configuration)

After installing the package, you can update the config/s3-direct-uploader.php configuration file with your s3 disk, file model, default thumbnail dimensions, and other settings.

```
php artisan vendor:publish --provider="Stianscholtz\S3DirectUploader\UploaderServiceProvider" --tag=config

```

Database Migration
------------------

[](#database-migration)

S3DirectUploader provides a migration file to create the files table in your database. To publish this migration, run:

```
php artisan vendor:publish

```

When prompted to select the service provider, choose:

```
Stianscholtz\S3DirectUploader\UploaderServiceProvider

```

Then, run the migration:

```
php artisan migrate

```

Usage
-----

[](#usage)

### Route Macro

[](#route-macro)

You can use the upload route macro for convenience or as an alternative to Route::match(\['get', 'post'\]).

```
Route::upload('/upload', [UploadController::class, 'upload'])->name('file.upload');

```

instead of

```
Route::match(['get', 'post'], '/upload', [UploadController::class, 'upload'])->name('file.upload');

```

### Controller

[](#controller)

```
use S3DirectUploader;
use App\Models\Banner; // Assuming your model name is Banner

public function upload(Banner $banner): Model|array|File
{
    return S3DirectUploader::directory('directory/sub-directory/another-sub-directory')
        ->mimeType('application/pdf')
        ->mimeTypes('image/jpg', 'image/jpeg', 'image/png', 'image/webp')
        ->imagesOnly()
        ->scale(1200)
        ->resize(1200, 400)
        ->thumbnail(500, 500)
        ->thumbnail(false) // Disable thumbnail generation, if default dimesions are specified in config
        ->maxSize(15)
        ->unique(false)
        ->prefix('my-prefix-')
        ->disk('s3-public')// Use another s3 disk configured in config/filesystems.php
        ->after(function (File $file) use ($banner) {
            $banner->update(['file_id', $file->id]);
        })
        ->handle();
}

```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a pull request.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance43

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~35 days

Total

7

Last Release

449d ago

PHP version history (3 changes)0.0.1PHP ~8.1.0|~8.2.0|~8.3.0

0.0.6PHP ^8.0

0.0.7PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0774550d0655ba034a6ec17044f16ce3da0c94c23bf788e95b83a3b25210df21?d=identicon)[Stian-Scholtz](/maintainers/Stian-Scholtz)

---

Top Contributors

[![stian-scholtz](https://avatars.githubusercontent.com/u/30631131?v=4)](https://github.com/stian-scholtz "stian-scholtz (1 commits)")

---

Tags

laravels3uploadfile-uploader

### Embed Badge

![Health badge](/badges/stianscholtz-s3-direct-uploader/health.svg)

```
[![Health](https://phpackages.com/badges/stianscholtz-s3-direct-uploader/health.svg)](https://phpackages.com/packages/stianscholtz-s3-direct-uploader)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[publiux/laravelcdn

Content Delivery Network (CDN) Package for Laravel

155233.5k](/packages/publiux-laravelcdn)[juhasev/laravelcdn

Content Delivery Network (CDN) Package for Laravel

1820.9k](/packages/juhasev-laravelcdn)

PHPackages © 2026

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