public function findInvoiceOrFail($id) { $invoice = $this->findInvoice($id); if (is_null($invoice)) { throw new NotFoundHttpException(); } else { return $invoice; } }