[FEAT] 完善個人資料頭像上傳功能與導覽列介面優化

This commit is contained in:
2026-03-13 09:30:07 +08:00
parent 773396fc90
commit ea460cf6d9
15 changed files with 234 additions and 382 deletions

View File

@@ -54,4 +54,16 @@ class User extends Authenticatable
{
return $this->hasMany(\App\Models\UserLoginLog::class);
}
/**
* Get the user's avatar URL.
*/
public function getAvatarUrlAttribute(): string
{
if ($this->avatar) {
return asset('storage/' . $this->avatar);
}
return "https://ui-avatars.com/api/?name=" . urlencode($this->name) . "&background=0D8ABC&color=fff";
}
}