nodes: rename port columns, add public_ port columns

This commit is contained in:
Matthew Penner 2021-02-11 10:21:32 -07:00
parent b7ee2195d7
commit 5f56ff0fed
9 changed files with 116 additions and 45 deletions

View file

@ -28,13 +28,7 @@ class NodeTransformer extends BaseTransformer
*/
public function transform(Node $model): array
{
$response = collect($model->toArray())->mapWithKeys(function ($value, $key) {
// I messed up early in 2016 when I named this column as poorly
// as I did. This is the tragic result of my mistakes.
$key = ($key === 'daemonSFTP') ? 'daemonSftp' : $key;
return [snake_case($key) => $value];
})->toArray();
$response = $model->toArray();
$response[$model->getUpdatedAtColumn()] = $this->formatTimestamp($model->updated_at);
$response[$model->getCreatedAtColumn()] = $this->formatTimestamp($model->created_at);