Skip to content

Commit

Permalink
has IP address when used as an ID in serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Sep 9, 2024
1 parent 1eab225 commit b594609
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/Api/Serializer/BasicIPInfoSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ protected function getDefaultAttributes($ip): array
*/
public function getId($model)
{
return $model->address;
return hash('sha256', $model->address);
}
}
10 changes: 0 additions & 10 deletions src/Api/Serializer/IPInfoSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,4 @@ protected function getDefaultAttributes($ip): array

return array_merge($attrs, $moreAttrs);
}

/**
* @param IPInfo $model
*
* @return string
*/
public function getId($model)
{
return $model->address;
}
}

0 comments on commit b594609

Please sign in to comment.