mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
hide id
This commit is contained in:
@@ -13,12 +13,20 @@ class ContractTemplateObligation extends Model
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_template_hash_id',
|
||||
'contract_template_list',
|
||||
'contract_template_obligation_dependency_list',
|
||||
'depend_contract_template_obligation_dependency_list',
|
||||
'contract_template_obligation_contract_template_dependency_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_template_id'
|
||||
];
|
||||
|
||||
public function contract_template()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractTemplate', 'contract_template_id');
|
||||
@@ -44,6 +52,16 @@ class ContractTemplateObligation extends Model
|
||||
return Hasher::encode('contract_template_obligations', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractTemplateHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_templates', $this->contract_template_id);
|
||||
}
|
||||
|
||||
public function getContractTemplateListAttribute()
|
||||
{
|
||||
return $this->contract_template()->get()->makeHidden(['contract_template_obligation_list']);
|
||||
|
||||
Reference in New Issue
Block a user