user()->hasRole('manager')) { $this->show_download_notification = session()->get('show-download.'.$project->id, $project->hasMissingDownloadsDateInHarvestFile()); $this->project = $project; } } public function getSessionKey() { return 'show-download.'.$this->project->id; } #[On('download_notify')] public function open() { if (auth()->user()->hasRole('manager')) { $this->show_download_notification = true; session([$this->getSessionKey() => true]); } } public function close(): void { $this->show_download_notification = false; session([$this->getSessionKey()=>false]); } public function startDownloads() { $this->project->handleMissingDownloads(); $this->close(); $this->dispatch('notify',message:'Downloads added to the queue.',type:'success'); } }