Merge branch 'staging' of itcorp.primaya.id:rajif/aso into staging

This commit is contained in:
2023-11-13 15:21:48 +07:00
7 changed files with 222 additions and 39 deletions

View File

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