bugs fix avatar
This commit is contained in:
@@ -250,10 +250,16 @@ class Member extends Model
|
||||
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
|
||||
);
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user