category qosishsh to'g'irlandi

This commit is contained in:
2026-04-29 13:55:41 +05:00
parent ac2c25bd06
commit a28f552f96

View File

@@ -147,7 +147,7 @@ class Category extends Model
public function getImage(): string public function getImage(): string
{ {
if (!in_array($this->image, ['null', null])) { if (!in_array($this->image, ['null', null])) {
if (Str::startsWith($this->image, 'uploads/categories/')) { if (Str::startsWith($this->image, 'uploads/categories/') && file_exists(public_path($this->image))) {
return asset($this->image); return asset($this->image);
} }