contact) { $this->contact = $this->purchase_order->vendor->contacts()->orderBy('send_email', 'DESC')->first(); } $invitation = $this->purchase_order->invitations()->where('vendor_contact_id', $this->contact->id)->first(); if (! $invitation) { $invitation = $this->purchase_order->invitations()->first(); } return (new CreateRawPdf($invitation))->handle(); } }