company->db); /** @var \App\Export\CSV\CreditExport $export */ $export = new $this->report_class($this->company, $this->request); if(isset($this->request['output']) && $this->request['output'] == 'json') { $report = $export->returnJson(); } else { $report = $export->run(); } Cache::put($this->hash, $report, 60 * 60); } public function middleware() { return [new WithoutOverlapping("report-{$this->company->company_key}")]; } }