- Hidden ID

This commit is contained in:
weiken.intex
2021-08-04 01:07:27 +08:00
parent 21944d9f3b
commit 69a0087ca6
8 changed files with 64 additions and 9 deletions
+10 -1
View File
@@ -11,7 +11,11 @@ class Entity extends Model
{
protected $table = 'entities';
protected $appends = ['hash_id', 'entity_signature_list'];
protected $appends = ['hash_id','user_hash_id', 'entity_signature_list'];
protected $hidden = [
'id','user_id',
];
public function entity_signature()
{
@@ -22,6 +26,11 @@ class Entity extends Model
{
return Hasher::encode('entities', $this->id);
}
public function getUserHashIdAttribute()
{
return Hasher::encode('user', $this->user_id);
}
public function getEntitySignatureListAttribute()
{