[ 'required', new NoUppercase, new IsNotPhoneNumber, new BlacklistedUsername, new SIPUsername, Rule::unique('accounts', 'username')->where(function ($query) { $query->where('domain', config('app.sip_domain')); }), 'filled', ], 'domain' => config('app.admins_manage_multi_domains') ? 'required' : '', 'password' => 'required|min:3', 'email' => 'nullable|email', 'dtmf_protocol' => 'nullable|in:' . Account::dtmfProtocolsRule(), 'phone' => [ 'nullable', 'unique:aliases,alias', 'unique:accounts,username', new WithoutSpaces, 'starts_with:+' ] ]; } }