fix: image media
This commit is contained in:
@@ -11,4 +11,12 @@ class Image extends Model
|
||||
public function user() {
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function getUrlAttribute()
|
||||
{
|
||||
return asset('storage/' . $this->path);
|
||||
}
|
||||
|
||||
// Make sure the URL is included when serializing
|
||||
protected $appends = ['url'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user