invoice = $invoice; $this->contact = $contact; $this->disk = $disk ?? config('filesystems.default'); } public function run() { $invitation = $this->invoice->invitations->first(); $file_path = sprintf('%sdelivery_note.pdf', $this->invoice->client->invoice_filepath($invitation)); $pdf = (new PdfService($invitation, 'delivery_note'))->getPdf(); Storage::disk($this->disk)->put($file_path, $pdf); return $file_path; } }