manual linking apps

This commit is contained in:
Linksehat Staging Server
2023-11-10 11:23:20 +07:00
parent 134caa2d2c
commit 0c9f69aaad
5 changed files with 127 additions and 29 deletions

View File

@@ -246,5 +246,14 @@ 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();
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path;
return Attribute::make(
get: fn () => $avatar ? $path : null
);
}
/* -------------------------------------------------------------------------- */
}