mutation = $mutation; $this->currentUrl = url()->current(); } public function monitorProgress() : void { $batch = Bus::findBatch($this->mutation->batch_id); $this->progress = $batch->progress(); $this->totalJobs = $batch->totalJobs; $this->processedJobs = $batch->processedJobs(); $this->failedJobs = $batch->failedJobs; if($batch == null || $batch->finished()) { $this->mutation->delete(); $this->redirect($this->currentUrl, navigate: true); } } public function render(): View|Factory { $this->monitorProgress(); return view('livewire.drawer.album.progress-monitor'); } }