mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 05:14:46 +02:00
33 lines
897 B
PHP
33 lines
897 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\ServerResource\Pages;
|
|
|
|
use App\Filament\Resources\ServerResource;
|
|
use App\Services\Servers\ServerCreationService;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CreateServer extends CreateRecord
|
|
{
|
|
protected static string $resource = ServerResource::class;
|
|
protected static bool $canCreateAnother = false;
|
|
|
|
protected function handleRecordCreation(array $data): Model
|
|
{
|
|
$data['allocation_additional'] = collect($data['allocation_additional'])->filter()->all();
|
|
|
|
/** @var ServerCreationService $service */
|
|
$service = resolve(ServerCreationService::class);
|
|
|
|
$server = $service->handle($data);
|
|
|
|
return $server;
|
|
}
|
|
|
|
// protected function getRedirectUrl(): string
|
|
// {
|
|
// return $this->getResource()::getUrl('edit');
|
|
// }
|
|
}
|