mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
hide id
This commit is contained in:
@@ -21,11 +21,15 @@ class Admin extends Authenticatable
|
||||
protected $table = 'admins';
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
'id',
|
||||
'name',
|
||||
'email',
|
||||
'password'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password', 'pivot'
|
||||
'password',
|
||||
'pivot'
|
||||
];
|
||||
|
||||
protected $appends = ['hash_id', 'role_list', 'permission_list'];
|
||||
|
||||
+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']);
|
||||
|
||||
@@ -11,7 +11,11 @@ class ContractEntity extends Model
|
||||
{
|
||||
protected $table = 'contract_entities';
|
||||
|
||||
protected $appends = ['hash_id', 'entity_signature_hash_id', 'contract_list', 'entity_list'];
|
||||
protected $appends = ['hash_id', 'user_hash_id', 'contract_hash_id', 'entity_hash_id', 'entity_signature_hash_id', 'contract_list', 'entity_list'];
|
||||
|
||||
protected $hidden = [
|
||||
'id', 'user_id', 'contract_id', 'entity_id', 'entity_sinature_id',
|
||||
];
|
||||
|
||||
public function contract()
|
||||
{
|
||||
@@ -28,6 +32,21 @@ class ContractEntity extends Model
|
||||
return Hasher::encode('contract_entities', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contracts', $this->contract_id);
|
||||
}
|
||||
|
||||
public function getEntityHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('entities', $this->entity_id);
|
||||
}
|
||||
|
||||
public function getEntitySignatureHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('entity_signatures', $this->entity_signature_id);
|
||||
|
||||
@@ -13,7 +13,9 @@ class ContractObligation extends Model
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_hash_id',
|
||||
'contract_template_obligation_hash_id',
|
||||
'contract_list',
|
||||
'contract_obligation_dependency_list',
|
||||
'depend_contract_obligation_dependency_list',
|
||||
@@ -22,6 +24,11 @@ class ContractObligation extends Model
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_id',
|
||||
'contract_template_obligation_id',
|
||||
'contract_entity_id',
|
||||
'in_time_contract_obligation_template',
|
||||
];
|
||||
|
||||
@@ -55,11 +62,26 @@ class ContractObligation extends Model
|
||||
return Hasher::encode('contract_obligations', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contracts', $this->contract_id);
|
||||
}
|
||||
|
||||
public function getContractTemplateObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_template_obligations', $this->contract_template_obligation_id);
|
||||
}
|
||||
|
||||
public function getContractEntityHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_entities', $this->contract_entity_id);
|
||||
}
|
||||
|
||||
public function getContractListAttribute()
|
||||
{
|
||||
return $this->contract()->get()->makeHidden(['contract_obligation_list']);
|
||||
|
||||
@@ -13,12 +13,21 @@ class ContractObligationContractDependency extends Model
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_obligation_hash_id',
|
||||
'depend_contract_hash_id',
|
||||
'contract_obligation_list',
|
||||
'depend_contract_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_id',
|
||||
'contract_obligation_id',
|
||||
'depend_contract_id',
|
||||
];
|
||||
|
||||
public function contract_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractObligation', 'contract_obligation_id');
|
||||
@@ -34,6 +43,11 @@ class ContractObligationContractDependency extends Model
|
||||
return Hasher::encode('contract_obligation_contract_dependencies', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_obligations', $this->contract_obligation_id);
|
||||
|
||||
@@ -19,6 +19,13 @@ class ContractObligationDependency extends Model
|
||||
'depend_contract_obligation_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_obligation_id',
|
||||
'depend_contract_obligation_id',
|
||||
];
|
||||
|
||||
public function contract_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractObligation', 'contract_obligation_id');
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -13,12 +13,20 @@ class ContractTemplateObligationContractTemplateDependency extends Model
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_template_obligation_hash_id',
|
||||
'depend_contract_template_hash_id',
|
||||
'contract_template_obligation_list',
|
||||
'depend_contract_template_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_template_obligation_id',
|
||||
'depend_contract_template_id'
|
||||
];
|
||||
|
||||
public function contract_template_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractTemplateObligation', 'contract_template_obligation_id');
|
||||
@@ -34,6 +42,11 @@ class ContractTemplateObligationContractTemplateDependency extends Model
|
||||
return Hasher::encode('contract_template_obligation_contract_template_dependencies', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractTemplateObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_template_obligations', $this->contract_template_obligation_id);
|
||||
|
||||
@@ -13,12 +13,20 @@ class ContractTemplateObligationDependency extends Model
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_hash_id',
|
||||
'contract_template_obligation_hash_id',
|
||||
'depend_contract_template_obligation_hash_id',
|
||||
'contract_template_obligation_list',
|
||||
'depend_contract_template_obligation_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
'contract_template_obligation_id',
|
||||
'depend_contract_template_obligation_id'
|
||||
];
|
||||
|
||||
public function contract_template_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractTemplateObligation', 'contract_template_obligation_id');
|
||||
@@ -34,6 +42,11 @@ class ContractTemplateObligationDependency extends Model
|
||||
return Hasher::encode('contract_template_obligation_dependencies', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getContractTemplateObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_template_obligations', $this->contract_template_obligation_id);
|
||||
|
||||
+15
-1
@@ -11,7 +11,16 @@ class Entity extends Model
|
||||
{
|
||||
protected $table = 'entities';
|
||||
|
||||
protected $appends = ['hash_id', 'entity_signature_list'];
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'user_id',
|
||||
'entity_signature_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
public function entity_signature()
|
||||
{
|
||||
@@ -23,6 +32,11 @@ class Entity extends Model
|
||||
return Hasher::encode('entities', $this->id);
|
||||
}
|
||||
|
||||
public function getUserHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('users', $this->user_id);
|
||||
}
|
||||
|
||||
public function getEntitySignatureListAttribute()
|
||||
{
|
||||
return $this->entity_signature()->get()->makeHidden(['entity_list']);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -15,7 +15,13 @@ class Permission extends Model
|
||||
'pivot'
|
||||
];
|
||||
|
||||
protected $appends = ['hash_id'];
|
||||
protected $appends = [
|
||||
'hash_id'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
];
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@ class Role extends Model
|
||||
protected $appends = ['hash_id', 'permission_list'];
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'pivot'
|
||||
];
|
||||
|
||||
|
||||
+8
-3
@@ -24,11 +24,16 @@ class User extends Authenticatable
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password',
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'role_list',
|
||||
'permission_list'
|
||||
];
|
||||
|
||||
protected $appends = ['hash_id', 'role_list', 'permission_list'];
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'password'
|
||||
];
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user