mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
hide id
This commit is contained in:
+21
-2
@@ -11,10 +11,19 @@ class Contract extends Model
|
||||
{
|
||||
protected $table = 'contracts';
|
||||
|
||||
protected $appends = ['hash_id', 'contract_obligation_list', 'contract_entity_list'];
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_template_hash_id',
|
||||
'contract_obligation_list',
|
||||
'contract_entity_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id', 'in_time_contract_template',
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_template_id',
|
||||
'in_time_contract_template'
|
||||
];
|
||||
|
||||
public function contract_obligation()
|
||||
@@ -32,6 +41,16 @@ class Contract extends Model
|
||||
return Hasher::encode('contracts', $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 getContractObligationListAttribute()
|
||||
{
|
||||
return $this->contract_obligation()->get()->makeHidden(['contract_list']);
|
||||
|
||||
Reference in New Issue
Block a user