Skip to content

Commit

Permalink
Refactor name of the package
Browse files Browse the repository at this point in the history
  • Loading branch information
mreduar committed Jul 21, 2024
1 parent 8e72b08 commit 52cd81c
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/Eduar Bastidas/laravel-s3-multipart/discussions/new?category=q-a
url: https://github.com/Eduar Bastidas/s3m/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/Eduar Bastidas/laravel-s3-multipart/discussions/new?category=ideas
url: https://github.com/Eduar Bastidas/s3m/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/Eduar Bastidas/laravel-s3-multipart/security/policy
url: https://github.com/Eduar Bastidas/s3m/security/policy
about: Learn how to notify us for sensitive bugs
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to `laravel-s3-multipart` will be documented in this file.
All notable changes to `s3m` will be documented in this file.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Multipart Uploads using Laravel and AWS S3
![Multipart Uploads using Laravel and AWS S3](https://raw.githubusercontent.com/mreduar/s3m/main/s3m-banner.png)

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mreduar/laravel-s3-multipart.svg?style=flat-square)](https://packagist.org/packages/mreduar/laravel-s3-multipart)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/mreduar/laravel-s3-multipart/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/mreduar/laravel-s3-multipart/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/mreduar/laravel-s3-multipart/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/mreduar/laravel-s3-multipart/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/mreduar/laravel-s3-multipart.svg?style=flat-square)](https://packagist.org/packages/mreduar/laravel-s3-multipart)
# S3M - Multipart Uploads using Laravel and AWS S3

Upload large files directly to AWS S3 using Laravel.
[![Latest Version on Packagist](https://img.shields.io/packagist/v/mreduar/s3m.svg?style=flat-square)](https://packagist.org/packages/mreduar/s3m)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/mreduar/s3m/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/mreduar/s3m/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/mreduar/s3m/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/mreduar/s3m/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/mreduar/s3m.svg?style=flat-square)](https://packagist.org/packages/mreduar/s3m)

Sometimes when running an application in a serverless environment, you may not store files permanently on the local filesystem, since you can never be sure that the same serverless "container" will be used on a subsequent request. All files should be stored in a cloud storage system, such as AWS S3, or in a shared file system through AWS EFS.

Expand All @@ -23,7 +23,7 @@ When uploading large files to S3, you may run into the 5GB limit for a single PU
You can install the package via composer:

```bash
composer require mreduar/laravel-s3-multipart
composer require mreduar/s3m
```

## Usage
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "mreduar/laravel-s3-multipart",
"name": "mreduar/s3m",
"description": "Multipart Uploads using Laravel and AWS S3",
"keywords": [
"Eduar Bastidas",
"laravel",
"laravel-s3-multipart"
"s3m"
],
"homepage": "https://github.com/mreduar/laravel-s3-multipart",
"homepage": "https://github.com/mreduar/s3m",
"license": "MIT",
"authors": [
{
Expand Down Expand Up @@ -36,19 +36,19 @@
},
"autoload": {
"psr-4": {
"MrEduar\\LaravelS3Multipart\\": "src/",
"MrEduar\\LaravelS3Multipart\\Database\\Factories\\": "database/factories/"
"MrEduar\\S3M\\": "src/",
"MrEduar\\S3M\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"MrEduar\\LaravelS3Multipart\\Tests\\": "tests/",
"MrEduar\\S3M\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"clear": "@php vendor/bin/testbench package:purge-laravel-s3-multipart --ansi",
"clear": "@php vendor/bin/testbench package:purge-s3m --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": [
"@composer run prepare",
Expand All @@ -74,10 +74,10 @@
"extra": {
"laravel": {
"providers": [
"MrEduar\\LaravelS3Multipart\\LaravelS3MultipartServiceProvider"
"MrEduar\\S3M\\S3MServiceProvider"
],
"aliases": {
"LaravelS3Multipart": "MrEduar\\LaravelS3Multipart\\Facades\\LaravelS3Multipart"
"S3M": "MrEduar\\S3M\\Facades\\S3M"
}
}
},
Expand Down
6 changes: 0 additions & 6 deletions config/s3-multipart.php

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"Amazon S3",
"S3"
],
"homepage": "https://github.com/mreduar/laravel-s3-multipart",
"bugs": "https://github.com/mreduar/laravel-s3-multipart/issues",
"homepage": "https://github.com/mreduar/s3m",
"bugs": "https://github.com/mreduar/s3m/issues",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/mreduar/laravel-s3-multipart.git"
"url": "git+https://github.com/mreduar/s3m.git"
},
"authors": [
{
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ parameters:
level: 5
paths:
- src
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;
use MrEduar\LaravelS3Multipart\Http\Controllers\S3MultipartController;
use MrEduar\S3M\Http\Controllers\S3MultipartController;

Route::get('s3m/create-multipart-upload', [S3MultipartController::class, 'createMultipartUpload'])->name('s3m.create-multipart');

Expand Down
Binary file added s3m-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/BladeFunctionGenerator.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace MrEduar\LaravelS3Multipart;
namespace MrEduar\S3M;

use MrEduar\LaravelS3Multipart\Output\Script;
use MrEduar\S3M\Output\Script;

class BladeFunctionGenerator
{
Expand Down
8 changes: 4 additions & 4 deletions src/Contracts/StorageMultipartUploadControllerContract.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace MrEduar\LaravelS3Multipart\Contracts;
namespace MrEduar\S3M\Contracts;

use Illuminate\Http\JsonResponse;
use MrEduar\LaravelS3Multipart\Http\Requests\CompleteMultipartUploadRequest;
use MrEduar\LaravelS3Multipart\Http\Requests\CreateMultipartUploadRequest;
use MrEduar\LaravelS3Multipart\Http\Requests\SignPartRequest;
use MrEduar\S3M\Http\Requests\CompleteMultipartUploadRequest;
use MrEduar\S3M\Http\Requests\CreateMultipartUploadRequest;
use MrEduar\S3M\Http\Requests\SignPartRequest;

interface StorageMultipartUploadControllerContract
{
Expand Down
6 changes: 3 additions & 3 deletions src/Facades/LaravelS3Multipart.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace MrEduar\LaravelS3Multipart\Facades;
namespace MrEduar\S3M\Facades;

use Illuminate\Support\Facades\Facade;

/**
* @see \MrEduar\LaravelS3Multipart\LaravelS3Multipart
* @see \MrEduar\S3M\S3M
*/
class LaravelS3Multipart extends Facade
{
protected static function getFacadeAccessor(): string
{
return \MrEduar\LaravelS3Multipart\LaravelS3Multipart::class;
return \MrEduar\S3M\S3M::class;

Check failure on line 14 in src/Facades/LaravelS3Multipart.php

View workflow job for this annotation

GitHub Actions / phpstan

Class MrEduar\S3M\S3M not found.
}
}
10 changes: 5 additions & 5 deletions src/Http/Controllers/S3MultipartController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MrEduar\LaravelS3Multipart\Http\Controllers;
namespace MrEduar\S3M\Http\Controllers;

use Aws\CommandInterface;
use Aws\S3\S3Client;
Expand All @@ -10,10 +10,10 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Str;
use InvalidArgumentException;
use MrEduar\LaravelS3Multipart\Contracts\StorageMultipartUploadControllerContract;
use MrEduar\LaravelS3Multipart\Http\Requests\CompleteMultipartUploadRequest;
use MrEduar\LaravelS3Multipart\Http\Requests\CreateMultipartUploadRequest;
use MrEduar\LaravelS3Multipart\Http\Requests\SignPartRequest;
use MrEduar\S3M\Contracts\StorageMultipartUploadControllerContract;
use MrEduar\S3M\Http\Requests\CompleteMultipartUploadRequest;
use MrEduar\S3M\Http\Requests\CreateMultipartUploadRequest;
use MrEduar\S3M\Http\Requests\SignPartRequest;

class S3MultipartController extends Controller implements StorageMultipartUploadControllerContract
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/CompleteMultipartUploadRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MrEduar\LaravelS3Multipart\Http\Requests;
namespace MrEduar\S3M\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/CreateMultipartUploadRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MrEduar\LaravelS3Multipart\Http\Requests;
namespace MrEduar\S3M\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Requests/SignPartRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MrEduar\LaravelS3Multipart\Http\Requests;
namespace MrEduar\S3M\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
Expand Down
5 changes: 0 additions & 5 deletions src/LaravelS3Multipart.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Output/Script.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace MrEduar\LaravelS3Multipart\Output;
namespace MrEduar\S3M\Output;

use Stringable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace MrEduar\LaravelS3Multipart;
namespace MrEduar\S3M;

use Illuminate\View\Compilers\BladeCompiler;
use MrEduar\LaravelS3Multipart\Http\Controllers\S3MultipartController;
use MrEduar\S3M\Http\Controllers\S3MultipartController;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

class LaravelS3MultipartServiceProvider extends PackageServiceProvider
class S3MServiceProvider extends PackageServiceProvider
{
public function configurePackage(Package $package): void
{
Expand All @@ -23,9 +23,8 @@ public function configurePackage(Package $package): void
}

$package
->name('laravel-s3-multipart')
->hasRoute('web')
->hasConfigFile();
->name('s3m')
->hasRoute('web');
}

protected function registerDirective(BladeCompiler $blade)
Expand Down
4 changes: 2 additions & 2 deletions tests/Common/Unit/BladeFunctionGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use MrEduar\LaravelS3Multipart\BladeFunctionGenerator;
use MrEduar\S3M\BladeFunctionGenerator;

test('render script tag', function () {
$routeFunction = file_get_contents(__DIR__.'/../../../dist/function.umd.js');
Expand All @@ -15,5 +15,5 @@
test('compile blade directive', function (string $blade, string $output) {
expect(app('blade.compiler')->compileString($blade))->toBe($output);
})->with([
['@s3m', "<?php echo app('MrEduar\LaravelS3Multipart\BladeFunctionGenerator')->generate(); ?>"],
['@s3m', "<?php echo app('MrEduar\S3M\BladeFunctionGenerator')->generate(); ?>"],
]);
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use MrEduar\LaravelS3Multipart\Tests\TestCase;
use MrEduar\S3M\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace MrEduar\LaravelS3Multipart\Tests;
namespace MrEduar\S3M\Tests;

use Mockery;
use MrEduar\LaravelS3Multipart\LaravelS3MultipartServiceProvider;
use MrEduar\S3M\S3MServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;

class TestCase extends Orchestra
Expand All @@ -23,7 +23,7 @@ protected function tearDown(): void
protected function getPackageProviders($app)
{
return [
LaravelS3MultipartServiceProvider::class,
S3MServiceProvider::class,
];
}

Expand Down

0 comments on commit 52cd81c

Please sign in to comment.