support S3 compatible storage providers (#401)

This commit is contained in:
Saeed Vaziry
2024-12-22 23:06:36 +01:00
committed by GitHub
parent db81583884
commit ea3d64607a
20 changed files with 127 additions and 576 deletions

View File

@ -0,0 +1,28 @@
<?php
use App\Enums\StorageProvider;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
public function up(): void
{
$wasabiProviders = \App\Models\StorageProvider::query()
->where('provider', 'wasabi')
->get();
/** @var \App\Models\StorageProvider $provider */
foreach ($wasabiProviders as $provider) {
$provider->provider = StorageProvider::S3;
$credentials = $provider->credentials;
$credentials['api_url'] = "https://{$credentials['bucket']}.s3.{$credentials['region']}.wasabisys.com";
$provider->credentials = $credentials;
$provider->save();
}
}
public function down(): void
{
//
}
};