mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix company logo issue
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Models;
|
||||
|
||||
use Crater\Models\Address;
|
||||
@ -17,9 +18,9 @@ class Company extends Model implements HasMedia
|
||||
|
||||
protected $fillable = ['name', 'logo', 'unique_hash'];
|
||||
|
||||
protected $appends=['logo'];
|
||||
protected $appends = ['logo', 'logo_path'];
|
||||
|
||||
public function getLogoAttribute()
|
||||
public function getLogoPathAttribute()
|
||||
{
|
||||
$logo = $this->getMedia('logo')->first();
|
||||
|
||||
@ -28,10 +29,22 @@ class Company extends Model implements HasMedia
|
||||
if ($logo) {
|
||||
if ($isSystem) {
|
||||
return $logo->getPath();
|
||||
} else {
|
||||
} else {
|
||||
return $logo->getFullUrl();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getLogoAttribute()
|
||||
{
|
||||
$logo = $this->getMedia('logo')->first();
|
||||
|
||||
if ($logo) {
|
||||
return $logo->getFullUrl();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user