From 72c0365aeed1e70e784ed119c0372f4afcf78c54 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 20 Mar 2017 13:56:24 +0200 Subject: [PATCH] Fix for Zapier search failure --- app/Http/Requests/InvoiceRequest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/InvoiceRequest.php b/app/Http/Requests/InvoiceRequest.php index 9a080f21428c..34365e2be2fe 100644 --- a/app/Http/Requests/InvoiceRequest.php +++ b/app/Http/Requests/InvoiceRequest.php @@ -17,7 +17,11 @@ class InvoiceRequest extends EntityRequest $invoice = Invoice::scope() ->whereInvoiceNumber($this->invoice_number) ->withTrashed() - ->firstOrFail(); + ->first(); + + if (! $invoice) { + abort(404); + } } // eager load the invoice items