where('student_id', $data['student_id']) ->where('id', '!=', $this->record->id) // ignore current record ->exists(); if ($exists) { Notification::make() ->title('Failed to save') ->body('Data untuk kombinasi guru, mata pelajaran, dan siswa ini sudah ada.') ->danger() ->send(); $this->halt(); } return $data; } protected function getHeaderActions(): array { return [ Actions\DeleteAction::make(), ]; } public function getTitle(): string { return 'Edit Penilaian'; } }