PHPackages                             baspa/laravel-s3-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. baspa/laravel-s3-uploader

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

baspa/laravel-s3-uploader
=========================

Upload local files and folders to S3 from an Artisan command

v1.0.0(1mo ago)015↓70%[1 PRs](https://github.com/Baspa/laravel-s3-uploader/pulls)MITPHPPHP ^8.2CI passing

Since Jun 4Pushed 3w agoCompare

[ Source](https://github.com/Baspa/laravel-s3-uploader)[ Packagist](https://packagist.org/packages/baspa/laravel-s3-uploader)[ Docs](https://github.com/baspa/laravel-s3-uploader)[ GitHub Sponsors](https://github.com/Baspa)[ RSS](/packages/baspa-laravel-s3-uploader/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (16)Versions (3)Used By (0)

Laravel S3 Uploader
===================

[](#laravel-s3-uploader)

[![Latest Version on Packagist](https://camo.githubusercontent.com/77ea7f213ad2305ae6ed0f6aa2fa4b0897cbf4e049be0ccb30ef0b3e3b3fd3f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62617370612f6c61726176656c2d73332d75706c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/baspa/laravel-s3-uploader)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4e4d30cf975179d22a1f2d27dbe1fcfdfd0128b004b8b900b58a782e7499f668/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62617370612f6c61726176656c2d73332d75706c6f616465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/baspa/laravel-s3-uploader/actions?query=workflow%3Arun-tests+branch%3Amain)[![PHPStan](https://camo.githubusercontent.com/7cc77775fa6ef53552ca6214168d39f4e6372a22fbd6a742220cf012c4fd106b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62617370612f6c61726176656c2d73332d75706c6f616465722f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/baspa/laravel-s3-uploader/actions?query=workflow%3APHPStan+branch%3Amain)[![Coverage](https://camo.githubusercontent.com/4b2231fdfa96048b8d4a5deec0d6cc946c85e1e9b8032028e7cd894abda5e8be/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f62617370612f6c61726176656c2d73332d75706c6f616465723f7374796c653d666c61742d737175617265)](https://codecov.io/gh/baspa/laravel-s3-uploader)[![Total Downloads](https://camo.githubusercontent.com/f931ceee6c3d2ba1f56294c2618e835895f9116cf8e2f1dd4cf020d707313c63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62617370612f6c61726176656c2d73332d75706c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/baspa/laravel-s3-uploader)

Upload a local folder to S3 (or any S3-compatible storage) with a single Artisan command. It reads your existing S3 credentials straight from your application's filesystem configuration, walks a directory recursively, and streams every file to a destination prefix on the bucket.

```
php artisan s3:upload storage/app/exports backups/2026
```

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

[](#installation)

Install the package via composer:

```
composer require baspa/laravel-s3-uploader
```

This package uploads through a standard Laravel filesystem disk, so you also need the S3 driver in your application (most Laravel apps already have it):

```
composer require league/flysystem-aws-s3-v3 "^3.0"
```

Optionally publish the config file:

```
php artisan vendor:publish --tag="laravel-s3-uploader-config"
```

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

[](#configuration)

The package uploads to a disk defined in your application's `config/filesystems.php`. By default it uses the `s3` disk, which is configured through the usual environment variables:

```
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_DEFAULT_REGION=eu-central-1
AWS_BUCKET=your-bucket
```

S3-compatible providers (MinIO, DigitalOcean Spaces, Cloudflare R2, …) work too — just set `AWS_ENDPOINT` on the `s3` disk as you normally would.

Want to point the package at a different disk? Publish the config and change the disk name, or set it in your `.env`:

```
S3_UPLOADER_DISK=backups
```

The published `config/s3-uploader.php`:

```
return [
    'disk' => env('S3_UPLOADER_DISK', 's3'),
];
```

Usage
-----

[](#usage)

```
php artisan s3:upload {source} {destination}
```

Argument / optionDescription`source`The local directory to upload.`destination`The destination folder (prefix) on the disk. Use `""` to upload to the bucket root.`--disk=`Upload to a specific disk instead of the configured default.`--force`Overwrite files that already exist on the disk. Without it, existing files are skipped.`--dry-run`Show what would be uploaded without writing anything.The directory is walked recursively and the folder structure is preserved under the destination prefix. For example, uploading a folder that contains `sub/report.pdf` to `backups/2026` stores it at `backups/2026/sub/report.pdf`.

### Examples

[](#examples)

Upload a folder, skipping anything already in the bucket:

```
php artisan s3:upload storage/app/exports backups/2026
```

Re-upload everything, overwriting existing objects:

```
php artisan s3:upload storage/app/exports backups/2026 --force
```

Preview the upload without touching S3:

```
php artisan s3:upload storage/app/exports backups/2026 --dry-run
```

Upload to a different disk:

```
php artisan s3:upload storage/app/exports backups/2026 --disk=spaces
```

The command shows a progress bar while uploading and prints a summary afterwards, e.g. `Uploaded: 12, Skipped: 3, Failed: 0`. It exits with a non-zero status code if any file failed to upload, so it is safe to use in scripts and CI.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Bas van Dinther](https://github.com/Baspa)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance93

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10845460?v=4)[Bas van Dinther](/maintainers/Baspa)[@Baspa](https://github.com/Baspa)

---

Top Contributors

[![Baspa](https://avatars.githubusercontent.com/u/10845460?v=4)](https://github.com/Baspa "Baspa (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

filesystemlaravels3awsuploadBaspa

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/baspa-laravel-s3-uploader/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20432.6M1.7k](/packages/illuminate-queue)[moonshine/moonshine

Laravel administration panel

1.3k253.1k86](/packages/moonshine-moonshine)[spatie/laravel-health

Monitor the health of a Laravel application

87912.0M177](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[laravel/folio

Page based routing for Laravel.

603583.7k34](/packages/laravel-folio)

PHPackages © 2026

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