category qosishsh to'g'irlandi

This commit is contained in:
2026-04-29 15:06:12 +05:00
parent 4297363cea
commit ba137edd1d
2 changed files with 20 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ class Screen extends Model
public function getPath(): string
{
if (!empty($this->path)) {
if (str_starts_with($this->path, 'uploads/') && file_exists(public_path($this->path))) {
return asset($this->path);
}
return Storage::url($this->path);
}
@@ -70,6 +74,10 @@ class Screen extends Model
public function getPathThumb(): string
{
if (!empty($this->path_thumb)) {
if (str_starts_with($this->path_thumb, 'uploads/') && file_exists(public_path($this->path_thumb))) {
return asset($this->path_thumb);
}
return Storage::url($this->path_thumb);
}