feat: 增强环境配置与开发服务,支持局域网访问及币种管理
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
@@ -23,8 +24,18 @@ final class AdminPlayerStoreRequest extends FormRequest
|
||||
'site_player_id' => ['required', 'string', 'max:128'],
|
||||
'username' => ['nullable', 'string', 'max:128'],
|
||||
'nickname' => ['nullable', 'string', 'max:128'],
|
||||
'default_currency' => ['sometimes', 'string', 'max:16'],
|
||||
'default_currency' => ['sometimes', 'string', 'max:16', Rule::exists('currencies', 'code')],
|
||||
'status' => ['sometimes', 'integer', 'in:0,1,2'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
if (! $this->has('default_currency')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$code = strtoupper(substr(trim((string) $this->input('default_currency')), 0, 16));
|
||||
$this->merge(['default_currency' => $code]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user