From 8653cc61145963f9a7a0f4ede25ba9a063bd5ab6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Jan 2021 08:22:42 +1100 Subject: [PATCH] Fixes for unique taxrate constraint on update --- app/Http/Requests/TaxRate/UpdateTaxRateRequest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/TaxRate/UpdateTaxRateRequest.php b/app/Http/Requests/TaxRate/UpdateTaxRateRequest.php index b40f6b2673..b72ba19175 100644 --- a/app/Http/Requests/TaxRate/UpdateTaxRateRequest.php +++ b/app/Http/Requests/TaxRate/UpdateTaxRateRequest.php @@ -28,7 +28,8 @@ class UpdateTaxRateRequest extends Request public function rules() { return [ - 'name' => 'unique:tax_rates,name,'.$this->tax_rate->name.',id,company_id,'.auth()->user()->companyId(), + // 'name' => 'unique:tax_rates,name,'.$this->tax_rate->name.',id,company_id,'.auth()->user()->companyId(), + 'name' => 'unique:tax_rates,name,'.$this->id.',id,company_id,'.$this->company_id, 'rate' => 'numeric', ]; }