action == ACTION_ARCHIVE) { return []; } $publicId = $this->route('invoices'); $invoiceId = Invoice::getPrivateId($publicId); $rules = [ 'invoice_items' => 'required|valid_invoice_items', 'invoice_number' => 'unique:invoices,invoice_number,'.$invoiceId.',id,account_id,'.Auth::user()->account_id, 'discount' => 'positive', ]; return $rules; } }