新增曾用名

This commit is contained in:
pllx
2026-05-19 18:01:47 +08:00
parent 74e4803bc2
commit 3c7cefe447
7 changed files with 47 additions and 4 deletions
+1
View File
@@ -85,6 +85,7 @@ class UserController extends Controller
$activePosition = $targetUser->activePosition?->load('position.department')->position;
$data = [
'username' => $targetUser->username,
'previous_name' => $targetUser->previous_name,
'sex' => match ((int) $targetUser->sex) {
1 => '男', 2 => '女', default => ''
},
@@ -31,6 +31,7 @@ class UpdateProfileRequest extends FormRequest
public function rules(): array
{
return [
'previous_name' => ['nullable', 'string', 'max:50'],
'sex' => ['required', 'in:0,1,2'],
'headface' => ['required', 'string', 'max:50'], // 比如存放 01.gif - 50.gif
'sign' => ['nullable', 'string', 'max:255'],
+1
View File
@@ -45,6 +45,7 @@ class User extends Authenticatable
*/
protected $fillable = [
'username',
'previous_name',
'password',
'email',
'sex',