mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
support S3 compatible storage providers (#401)
This commit is contained in:
@ -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
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user