request->get('company_id'); // Check if store or update if ($this->getMethod() == 'PATCH') { $id = $this->vendor->getAttribute('id'); } else { $id = null; } if (!empty($this->request->get('email'))) { $email = 'email|unique:vendors,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL'; } return [ 'name' => 'required|string', 'email' => $email, 'currency_code' => 'required|string', ]; } }