Skip to content

Commit 26e275d

Browse files
committed
Initial commit
0 parents  commit 26e275d

14 files changed

+600
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
composer.lock
3+
vendor
4+
.phpunit.result.cache
5+
.php_cs.cache

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
All notable changes to `laravel-uppy-s3-multipart-upload` will be documented in this file.
4+
5+
## 1.0.0 - 202X-XX-XX
6+
7+
- initial release

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) tapp network <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Multipart Uploads using Laravel, AWS S3, and Uppy
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/tapp network/laravel-uppy-s3-multipart-upload.svg?style=flat-square)](https://packagist.org/packages/tapp network/laravel-uppy-s3-multipart-upload)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/tapp network/laravel-uppy-s3-multipart-upload/run-tests?label=tests)](https://github.com/tapp network/laravel-uppy-s3-multipart-upload/actions?query=workflow%3ATests+branch%3Amaster)
5+
[![Total Downloads](https://img.shields.io/packagist/dt/tapp network/laravel-uppy-s3-multipart-upload.svg?style=flat-square)](https://packagist.org/packages/tapp network/laravel-uppy-s3-multipart-upload)
6+
7+
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
8+
9+
## Installation
10+
11+
You can install the package via composer:
12+
13+
```bash
14+
composer require tappnetwork/laravel-uppy-s3-multipart-upload
15+
```
16+
17+
You can publish the config file with:
18+
```bash
19+
php artisan vendor:publish --provider="TappNetwork\LaravelUppyS3MultipartUpload\LaravelUppyS3MultipartUploadServiceProvider" --tag="laravel-uppy-s3-multipart-upload-config"
20+
```
21+
22+
This is the contents of the published config file:
23+
24+
```php
25+
return [
26+
];
27+
```
28+
29+
Disable CSRF on `s3/multipart` routes by adding this in your `app/Http/Middleware/VerifyCsrfToken.php`:
30+
31+
```php
32+
protected $except = [
33+
's3/multipart*',
34+
];
35+
```
36+
37+
Add these Uppy JS libraries on your `package.json` file:
38+
39+
```json
40+
...
41+
"dependencies": {
42+
"@uppy/aws-s3-multipart": "^1.8.12",
43+
"@uppy/core": "^1.16.0",
44+
"@uppy/drag-drop": "^1.4.24",
45+
"@uppy/status-bar": "^1.9.0",
46+
...
47+
}
48+
...
49+
```
50+
51+
Install the JS libraries:
52+
53+
```
54+
$ npm install
55+
$ npm run dev
56+
```
57+
58+
## Usage
59+
60+
61+
62+
## Testing
63+
64+
```bash
65+
composer test
66+
```
67+
68+
## Changelog
69+
70+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
71+
72+
## Contributing
73+
74+
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
75+
76+
## Security Vulnerabilities
77+
78+
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
79+
80+
## Credits
81+
82+
- [Tapp Network](https://github.com/TappNetwork)
83+
- [All Contributors](../../contributors)
84+
85+
## License
86+
87+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "tappnetwork/laravel-uppy-s3-multipart-upload",
3+
"description": "Multipart Uploads using Laravel, AWS S3, and Uppy",
4+
"keywords": [
5+
"tapp network",
6+
"laravel-uppy-s3-multipart-upload"
7+
],
8+
"homepage": "https://github.com/TappNetwork/laravel-uppy-s3-multipart-upload",
9+
"license": "MIT",
10+
"authors": [
11+
{
12+
"name": "Tapp Network",
13+
"email": "[email protected]",
14+
"role": "Developer"
15+
}
16+
],
17+
"require": {
18+
"php": "^7.4|^8.0",
19+
"aws/aws-sdk-php": "^3.171",
20+
"spatie/laravel-package-tools": "^1.1",
21+
"illuminate/contracts": "^8.0"
22+
},
23+
"require-dev": {
24+
"orchestra/testbench": "^6.0",
25+
"phpunit/phpunit": "^9.3",
26+
"spatie/laravel-ray": "^1.9",
27+
"vimeo/psalm": "^4.4"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"TappNetwork\\LaravelUppyS3MultipartUpload\\": "src",
32+
"TappNetwork\\LaravelUppyS3MultipartUpload\\Database\\Factories\\": "database/factories"
33+
}
34+
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"TappNetwork\\LaravelUppyS3MultipartUpload\\Tests\\": "tests"
38+
}
39+
},
40+
"scripts": {
41+
"psalm": "vendor/bin/psalm",
42+
"test": "vendor/bin/phpunit --colors=always",
43+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
44+
},
45+
"config": {
46+
"sort-packages": true
47+
},
48+
"extra": {
49+
"laravel": {
50+
"providers": [
51+
"TappNetwork\\LaravelUppyS3MultipartUpload\\LaravelUppyS3MultipartUploadServiceProvider"
52+
],
53+
"aliases": {
54+
"LaravelUppyS3MultipartUpload": "TappNetwork\\LaravelUppyS3MultipartUpload\\LaravelUppyS3MultipartUploadFacade"
55+
}
56+
}
57+
},
58+
"minimum-stability": "dev",
59+
"prefer-stable": true
60+
}

config/uppy-s3-multipart-upload.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
5+
];

database/factories/ModelFactory.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Tapp Network\LaravelUppyS3MultipartUpload\Database\Factories;
4+
5+
use Illuminate\Database\Eloquent\Factories\Factory;
6+
7+
/*
8+
class ModelFactory extends Factory
9+
{
10+
protected $model = YourModel::class;
11+
12+
public function definition()
13+
{
14+
return [
15+
16+
];
17+
}
18+
}
19+
*/

resources/views/.gitkeep

Whitespace-only changes.

routes/web.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use TappNetwork\LaravelUppyS3MultipartUpload\Http\Controllers\UppyS3MultipartController;
4+
use Illuminate\Support\Facades\Route;
5+
6+
Route::post('/s3/multipart', [UppyS3MultipartController::class, 'createMultipartUpload']);
7+
8+
Route::options('/s3/multipart', [UppyS3MultipartController::class, 'createMultipartUploadOptions']);
9+
10+
Route::get('/s3/multipart/{uploadId}', [UppyS3MultipartController::class, 'getUploadedParts']);
11+
12+
Route::get('/s3/multipart/{uploadId}/{partNumber}', [UppyS3MultipartController::class, 'prepareUploadPart']);
13+
14+
Route::post('/s3/multipart/{uploadId}/complete', [UppyS3MultipartController::class, 'completeMultipartUpload']);
15+
16+
Route::delete('/s3/multipart/{uploadId}', [UppyS3MultipartController::class, 'abortMultipartUpload']);

src/Http/Controllers/Controller.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace TappNetwork\LaravelUppyS3MultipartUpload\Http\Controllers;
4+
5+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6+
use Illuminate\Foundation\Bus\DispatchesJobs;
7+
use Illuminate\Foundation\Validation\ValidatesRequests;
8+
use Illuminate\Routing\Controller as BaseController;
9+
10+
class Controller extends BaseController
11+
{
12+
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13+
}

0 commit comments

Comments
 (0)