fix 1.2.8 - logo app
This commit is contained in:
+14
-12
@@ -5,7 +5,9 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class AppSetting extends Model
|
||||
{
|
||||
@@ -107,38 +109,38 @@ class AppSetting extends Model
|
||||
|
||||
public function getLogoUrlInstance(): ?string
|
||||
{
|
||||
if ($this->logo && file_exists(public_path('storage/' . $this->logo))) {
|
||||
return asset('storage/' . $this->logo);
|
||||
if ($this->logo && Storage::disk('public')->exists($this->logo)) {
|
||||
return Storage::disk('public')->url($this->logo);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getLogoSmallUrlInstance(): ?string
|
||||
{
|
||||
if ($this->logo_small && file_exists(public_path('storage/' . $this->logo_small))) {
|
||||
return asset('storage/' . $this->logo_small);
|
||||
if ($this->logo_small && Storage::disk('public')->exists($this->logo_small)) {
|
||||
return Storage::disk('public')->url($this->logo_small);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getLogoPath(): ?string
|
||||
{
|
||||
if ($this->logo_path && file_exists(public_path('storage/' . $this->logo_path))) {
|
||||
return asset('storage/' . $this->logo_path);
|
||||
if ($this->logo_path && Storage::disk('public')->exists($this->logo_path)) {
|
||||
return Storage::disk('public')->url($this->logo_path);
|
||||
}
|
||||
if ($this->logo && file_exists(public_path('storage/' . $this->logo))) {
|
||||
return asset('storage/' . $this->logo);
|
||||
if ($this->logo && Storage::disk('public')->exists($this->logo)) {
|
||||
return Storage::disk('public')->url($this->logo);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getLogoSmallPath(): ?string
|
||||
{
|
||||
if ($this->logo_small_path && file_exists(public_path('storage/' . $this->logo_small_path))) {
|
||||
return asset('storage/' . $this->logo_small_path);
|
||||
if ($this->logo_small_path && Storage::disk('public')->exists($this->logo_small_path)) {
|
||||
return Storage::disk('public')->url($this->logo_small_path);
|
||||
}
|
||||
if ($this->logo_small && file_exists(public_path('storage/' . $this->logo_small))) {
|
||||
return asset('storage/' . $this->logo_small);
|
||||
if ($this->logo_small && Storage::disk('public')->exists($this->logo_small)) {
|
||||
return Storage::disk('public')->url($this->logo_small);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user