$info) { $value = false; if ($this->has(sprintf('notification_%s', $key))) { $value = true; } $return[$key] = $value; } $return['discord_url'] = $this->convertString('discord_url'); $return['slack_url'] = $this->convertString('slack_url'); return $return; } /** * Rules for this request. */ public function rules(): array { $rules = [ 'discord_url' => ['nullable', 'url', 'min:1', new IsValidDiscordUrl()], 'slack_url' => ['nullable', 'url', 'min:1', new IsValidSlackUrl()], ]; foreach (config('notifications.notifications.owner') as $key => $info) { $rules[sprintf('notification_%s', $key)] = 'in:0,1'; } return $rules; } }