Populate these fields for server variables

This commit is contained in:
Lance Pioch 2024-04-27 22:49:27 -04:00
parent 6b0c1d136b
commit 2d7804311d

View File

@ -173,11 +173,15 @@ class ServerCreationService
*/ */
private function storeEggVariables(Server $server, Collection $variables): void private function storeEggVariables(Server $server, Collection $variables): void
{ {
$records = $variables->map(function ($result) use ($server) { $now = now();
$records = $variables->map(function ($result) use ($server, $now) {
return [ return [
'server_id' => $server->id, 'server_id' => $server->id,
'variable_id' => $result->id, 'variable_id' => $result->id,
'variable_value' => $result->value ?? '', 'variable_value' => $result->value ?? '',
'created_at' => $now,
'updated_at' => $now,
]; ];
})->toArray(); })->toArray();