'required|string', 'phone_number_id' => 'required|string', 'whatsapp_api_url' => 'required|url', 'webhook_verify_token' => 'required|string', 'welcome_message' => 'required|string|max:1000', 'default_no_match' => 'required|string|max:500', 'advisor_message' => 'required|string|max:500', ]; public function mount(): void { $keys = [ 'whatsapp_token', 'phone_number_id', 'whatsapp_api_url', 'webhook_verify_token', 'bot_enabled', 'welcome_message', 'default_no_match', 'advisor_message', 'business_hours_enabled', 'business_hours_start', 'business_hours_end', ]; foreach ($keys as $key) { $this->{$key} = WhatsappSystemConfig::get($key); } } public function save(): void { $this->validate(); $keys = [ 'whatsapp_token', 'phone_number_id', 'whatsapp_api_url', 'webhook_verify_token', 'bot_enabled', 'welcome_message', 'default_no_match', 'advisor_message', 'business_hours_enabled', 'business_hours_start', 'business_hours_end', ]; foreach ($keys as $key) { WhatsappSystemConfig::set($key, $this->{$key}); } $this->alert('success', 'Configuración guardada correctamente.'); } public function render() { return view('livewire.whatsapp.show-configuracion-bot'); } }