fix logo display issue

This commit is contained in:
raishvaria
2021-01-15 14:22:42 +05:30
parent 8eeafd3fed
commit 9c5e9e56f5
4 changed files with 12 additions and 32 deletions

View File

@ -22,10 +22,17 @@ class Company extends Model implements HasMedia
public function getLogoAttribute()
{
$logo = $this->getMedia('logo')->first();
$isSystem = FileDisk::whereSetAsDefault(true)->first()->isSystem();
if ($logo) {
return asset($logo->getUrl());
if ($isSystem) {
return $logo->getPath();
} else {
return $logo->getFullUrl();
}
}
return ;
return null;
}
public function user()