[Clien Portal] Alarm Center - Service Monitoring

This commit is contained in:
Muhammad Fajar
2024-01-14 11:35:44 +07:00
parent d659e8fd4e
commit 62d5dce772
9 changed files with 698 additions and 456 deletions

View File

@@ -394,22 +394,22 @@ class Member extends Model
// );
// }
protected function corporateLogo(): Attribute
{
$avatar = null;
// protected function corporateLogo(): Attribute
// {
// $avatar = null;
if ($this->relationLoaded('currentPolicy')) {
$corporateId = $this->currentPolicy->corporate->id;
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $corporateId])
->orderBy('id', 'desc')
->first();
}
// if ($this->relationLoaded('currentPolicy')) {
// $corporateId = $this->currentPolicy->corporate->id;
// $avatar = File::where(['type' => 'avatar', 'fileable_id' => $corporateId])
// ->orderBy('id', 'desc')
// ->first();
// }
$path = $avatar ? $_ENV['LMS_APP_STORAGE'] . $avatar->path : '';
// $path = $avatar ? $_ENV['LMS_APP_STORAGE'] . $avatar->path : '';
return Attribute::make(
get: fn () => $path
);
}
// return Attribute::make(
// get: fn () => $path
// );
// }
/* -------------------------------------------------------------------------- */
}