Skip to content

Commit e8aecc5

Browse files
committed
make sure server_id is set
1 parent 0671f8b commit e8aecc5

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

subdomains/src/Filament/Admin/Resources/Servers/RelationManagers/SubdomainRelationManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public function table(Table $table): Table
8686
->createAnother(false)
8787
->action(function (array $data, SubdomainService $service) {
8888
try {
89+
$data['server_id'] = $this->getOwnerRecord()->id;
90+
8991
return $service->handle($data);
9092
} catch (Exception $exception) {
9193
Notification::make()

subdomains/src/Filament/Server/Resources/Subdomains/SubdomainResource.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ public static function table(Table $table): Table
115115
->iconSize(IconSize::ExtraLarge)
116116
->action(function (array $data, SubdomainService $service) {
117117
try {
118+
/** @var Server $server */
119+
$server = Filament::getTenant();
120+
121+
$data['server_id'] = $server->id;
122+
118123
return $service->handle($data);
119124
} catch (Exception $exception) {
120125
Notification::make()

0 commit comments

Comments
 (0)