alternativeSave($data, $invoice); } /** * Mark the invoice as sent. * * @param \App\Models\Invoice $invoice The invoice * * @return Invoice|\App\Models\Invoice|null Return the invoice object */ public function markSent(Invoice $invoice):?Invoice { return $invoice->service()->markSent()->save(); } public function getInvitationByKey($key) :?InvoiceInvitation { return InvoiceInvitation::whereRaw("BINARY `key`= ?", [$key])->first(); } }