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 ContractTemplate extends Model
{
protected $table = 'contract_templates';
protected $appends = ['hash_id', 'contract_template_obligation_list'];
protected $appends = [
'hash_id',
'user_hash_id',
'contract_template_obligation_list'
];
protected $hidden = [
'id',
'user_id',
];
public function contract_template_obligation()
{
@@ -23,6 +32,11 @@ class ContractTemplate extends Model
return Hasher::encode('contract_templates', $this->id);
}
public function getUserHashIdAttribute()
{
return Hasher::encode('users', $this->user_id);
}
public function getContractTemplateObligationListAttribute()
{
return $this->contract_template_obligation()