feat: add image_url

This commit is contained in:
2025-11-25 16:13:42 +03:30
parent 8e5ecd3898
commit 5c030bb639
+10
View File
@@ -17,4 +17,14 @@ class Promotion extends Model
'start_at' => 'datetime',
'end_at' => 'datetime'
];
protected $appends = ['image_url'];
public function getImageUrlAttribute()
{
if ($this->image) {
return Storage::disk('public')->url($this->image);
}
return null;
}
}