list dokter, list RS
This commit is contained in:
@@ -27,7 +27,17 @@ class Address extends Model
|
||||
'period_start',
|
||||
'period_end',
|
||||
];
|
||||
|
||||
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function addressable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
|
||||
@@ -24,9 +24,18 @@ class Organization extends Model
|
||||
// 'metas'
|
||||
// ];
|
||||
|
||||
// public $appends = [
|
||||
// 'meta'
|
||||
// ];
|
||||
public $appends = [
|
||||
'meta'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
/**
|
||||
* Scope a query to only include active data.
|
||||
|
||||
@@ -19,6 +19,21 @@ class PractitionerRole extends Model
|
||||
'active',
|
||||
];
|
||||
|
||||
public $appends = [
|
||||
'meta'
|
||||
];
|
||||
|
||||
public function getMetaAttribute()
|
||||
{
|
||||
$orgMeta = [];
|
||||
foreach ($this->metas as $meta) {
|
||||
$orgMeta[$meta->type] = $meta->value;
|
||||
}
|
||||
|
||||
return (object) $orgMeta;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Scope a query to only include active data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user