bugs fix avatar
This commit is contained in:
@@ -250,10 +250,16 @@ class Member extends Model
|
|||||||
protected function corporateLogo(): Attribute
|
protected function corporateLogo(): Attribute
|
||||||
{
|
{
|
||||||
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $this->currentPolicy->corporate->id])->orderBy('id', 'desc')->get()->first();
|
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $this->currentPolicy->corporate->id])->orderBy('id', 'desc')->get()->first();
|
||||||
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path;
|
if ($avatar){
|
||||||
return Attribute::make(
|
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path ? $avatar->path :'';
|
||||||
get: fn () => $avatar ? $path : null
|
return Attribute::make(
|
||||||
);
|
get: fn () => $avatar ? $path : null
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Attribute::make(
|
||||||
|
get: fn () => null
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user