branch_id = $branch_id; $this->branch_name = Branch::find($branch_id)->name; $this->reset('syncBranch', 'syncSong', 'syncFavorite', 'syncTextAds', 'syncUser'); $this->showModal = true; } public function closeModal() { $this->showModal = false; } public function save() { if ($this->syncBranch) { ExportSqliteBranchJob::dispatch($this->branch_id); } if ($this->syncSong) { ExportSqliteSongJob::dispatch($this->branch_id); } if ($this->syncFavorite) { ExportSqliteFavoriteJob::dispatch($this->branch_id); } if($this->syncTextAds){ ExportSqliteTextAdJob::dispatch($this->branch_id); } if ($this->syncUser) { ExportSqliteUserJob::dispatch(true, $this->branch_id); } $this->notification()->send([ 'icon' => 'success', 'title' => '同步任務', 'description' => '已加入排程', ]); $this->showModal = false; } public function render() { return view('livewire.modals.branch-sync-modal'); } }