修复:headface accessor 自动转小写后缀

- getter 使用 strtolower() 兼容数据库中存量的 .GIF 大写记录
- setter 也自动转小写,确保新数据统一
This commit is contained in:
2026-02-26 23:30:41 +08:00
parent bfd90ca882
commit 2735cbf1dd
+3 -2
View File
@@ -88,8 +88,9 @@ class User extends Authenticatable
protected function headface(): Attribute
{
return Attribute::make(
get: fn () => $this->usersf ?: '1.gif',
set: fn (string $value) => ['usersf' => $value],
// 自动将后缀转小写,兼容数据库中的 .GIF 大写存量
get: fn () => strtolower($this->usersf ?: '1.gif'),
set: fn (string $value) => ['usersf' => strtolower($value)],
);
}