['required', 'string'], 'alias' => ['sometimes', 'nullable', 'string', 'max:191'], 'ports' => ['required', 'array'], 'ports.*' => ['string'], ]; } /** * The validated input under the action's field names: ip, ports and alias are its * allocation_ip, allocation_ports and allocation_alias. * * @return array */ public function actionInput(): array { $input = parent::actionInput(); return [ 'allocation_ip' => $input['ip'] ?? null, 'allocation_ports' => $input['ports'] ?? null, 'allocation_alias' => $input['alias'] ?? null, ]; } }