['nullable', new Enum(Lang::class)], 'timezone' => ['nullable', Rule::in(Helpers::getTimeZoneList()->keys()->toArray())] ]; } public function getDto(): UpdateSettings { $lang = $this->input('lang', null); if (!is_null($lang)) { $lang = Lang::from((int) $lang); } return new UpdateSettings( lang: $lang, timezone: $this->input('timezone', null), ); } }