authorize('update', $vault); $this->form->setVault($vault); } #[On('open-modal')] public function open(?VaultNode $parent = null, bool $isFile = true): void { if (!is_null($parent->vault)) { $this->authorize('update', $parent->vault); } $this->form->parent_id = $parent->id; $this->form->is_file = $isFile; $this->openModal(); } public function add(): void { $this->form->create(); $this->closeModal(); $this->dispatch('node-updated'); } public function render() { return view('livewire.modals.addNode'); } }