feat: add storage_url helper function and update image URL retrieval to use public disk

This commit is contained in:
2025-11-30 08:20:51 -05:00
parent 5f7f2098ec
commit d4c90da807
6 changed files with 47 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ class UserProfile extends Model
public function getAvatarUrlAttribute(): ?string
{
if ($this->avatar_path) {
return Storage::url($this->avatar_path);
return Storage::disk('public')->url($this->avatar_path);
}
// Return default avatar or gravatar
@@ -135,7 +135,7 @@ class UserProfile extends Model
public function getBannerUrlAttribute(): ?string
{
if ($this->banner_path) {
return Storage::url($this->banner_path);
return Storage::disk('public')->url($this->banner_path);
}
return null;