category qosishsh to'g'irlandi

This commit is contained in:
2026-04-29 13:53:09 +05:00
parent 6937deecbe
commit ac2c25bd06
3 changed files with 48 additions and 4 deletions

View File

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