route('pengurusKoperasi'); return $pengurus instanceof PengurusKoperasi && $pengurus->profilLengkap(); } public function attributes(): array { $attributes = []; foreach (array_keys($this->rules()) as $field) { $attributes[$field] = ucfirst(str_replace(['_', '.*'], [' ', ''], $field)); } return $attributes; } protected function prepareForValidation(): void { parent::prepareForValidation(); // Checkbox yang dikosongkan harus menghapus pilihan yang sebelumnya tersimpan. foreach ($this->rules() as $field => $rules) { if (in_array('array', $rules, true) && ! $this->exists($field)) { $this->merge([$field => []]); } } } }