getAttribute('id'); $picture = 'nullable'; if ($this->request->get('picture', null)) { $picture = 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024; } $email = 'required|email|unique:users,email,' . $id . ',id,deleted_at,NULL'; if (user()->contact) { $email .= '|unique:contacts,NULL,' . user()->contact->id . ',id' . ',company_id,' . company_id() . ',type,customer' . ',deleted_at,NULL'; } return [ 'name' => 'required|string', 'email' => $email, 'password' => 'confirmed', 'picture' => $picture, ]; } }