This commit is contained in:
glovetleong
2021-08-05 14:01:33 +08:00
parent 9f5224bc73
commit e3b6c69718
17 changed files with 215 additions and 26 deletions
+15 -1
View File
@@ -11,7 +11,16 @@ class EntitySignature extends Model
{
protected $table = 'entity_signatures';
protected $appends = ['hash_id', 'entity_list'];
protected $appends = [
'hash_id',
'entity_hash_id',
'entity_list'
];
protected $hidden = [
'id',
'entity_id',
];
public function entity()
{
@@ -23,6 +32,11 @@ class EntitySignature extends Model
return Hasher::encode('entity_signatures', $this->id);
}
public function getEntityHashIdAttribute()
{
return Hasher::encode('entities', $this->entity_id);
}
public function getEntityListAttribute()
{
return $this->entity()->get()->makeHidden(['entity_signature_list']);