user()->created_at->lt(now()->subMonth()); $noAccount = !$this->user()->matrix_id; return $isOldEnough && $noAccount; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'username' => [ 'required', 'string', 'min:3', 'max:32', 'regex:/^[a-z0-9._=-]+$/', // Valid Matrix localpart ], 'password' => [ 'required', 'string', 'min:8', 'confirmed', ], ]; } public function messages(): array { return [ 'username.regex' => 'Username may only contain lowercase letters, numbers and . _ = -', ]; } }