'Link clicked', 'link.created' => 'Link created', 'link.updated' => 'Link updated', 'link.deleted' => 'Link deleted', ]; protected function rules(): array { return [ 'url' => 'required|url|max:2048', 'secret' => 'nullable|string|max:255', 'selectedEvents' => 'required|array|min:1', 'selectedEvents.*' => 'string|in:'.implode(',', array_keys($this->availableEvents)), ]; } public function save(): void { $this->validate(); $workspace = app('current_workspace'); Webhook::create([ 'workspace_id' => $workspace->id, 'url' => $this->url, 'secret' => $this->secret ?: Str::random(32), 'events' => $this->selectedEvents, 'is_active' => true, ]); $this->dispatch('webhookCreated'); $this->closeModal(); } public function render(): View { return view('livewire.modals.create-webhook'); } }