This commit is contained in:
Saeed Vaziry
2024-09-27 20:36:03 +02:00
committed by GitHub
parent b62c40c97d
commit f6bc04763b
122 changed files with 6609 additions and 807 deletions

View File

@ -10,7 +10,6 @@
use Exception;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Facades\Storage;
use Illuminate\Validation\Rule;
use Throwable;
class AWS extends AbstractProvider
@ -21,12 +20,7 @@ class AWS extends AbstractProvider
public function createRules(array $input): array
{
$rules = [
'os' => [
'required',
Rule::in(config('core.operating_systems')),
],
];
$rules = [];
// plans
$plans = [];
foreach (config('serverproviders.aws.plans') as $plan) {
@ -82,14 +76,18 @@ public function connect(?array $credentials = null): bool
}
}
public function plans(): array
public function plans(?string $region): array
{
return config('serverproviders.aws.plans');
return collect(config('serverproviders.aws.plans'))
->mapWithKeys(fn ($value) => [$value['value'] => $value['title']])
->toArray();
}
public function regions(): array
{
return config('serverproviders.aws.regions');
return collect(config('serverproviders.aws.regions'))
->mapWithKeys(fn ($value) => [$value['value'] => $value['title']])
->toArray();
}
public function create(): void