{inapp: bool, email: bool} * @property null|string $frequency instant | daily | weekly | never */ final class SaveNotificationPreferencesRequest extends Request { public function authorize() { return is_user_logged_in(); } public function failedAuthorizationMessage(): string { return 'You must be logged in to change your notification settings.'; } public function rules() { return [ 'types' => ['nullable', 'array'], 'frequency' => ['nullable', 'string'], ]; } public function messages() { return [ 'frequency.string' => \sprintf( // translators: %s: comma-separated list of valid email frequencies __('Choose one of: %s.', 'bit-connect'), implode(', ', NotificationSettings::frequencies()) ), ]; } }