Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Stores rater personal details (name/email) encrypted at rest while preserving duplicate prevention via a deterministic email_hash, and updates related model relationships and admin UI/test expectations to match the new storage/search constraints.
Changes:
- Add encrypted casting for
Rater.name/Rater.emailand maintain a derivedemail_hashfor uniqueness. - Migrate existing rater rows to encrypted values and introduce
(subject_id, email_hash)uniqueness. - Update Filament tables and model relationship/tests to reflect the new behavior (reduced searchability, relationship key fixes).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/Models/RaterTest.php | Updates unit tests to reflect updated/added rater relationships. |
| tests/Feature/Models/RaterTest.php | Removes outdated relationship expectation test. |
| database/migrations/2026_06_23_114142_add_email_hash_to_raters_table.php | Adds email_hash, encrypts existing data, and updates unique/index strategy. |
| CHANGELOG.md | Documents the new encrypted rater storage change. |
| app/Models/User.php | Fixes User->raters() foreign/local keys to match subject_id usage. |
| app/Models/Rater.php | Adds encrypted casts, derives email_hash on save, and renames relationship to subject(). |
| app/Filament/Resources/Raters/Tables/RatersTable.php | Removes name/email searching and updates search guidance for encrypted fields. |
| app/Filament/Resources/Assessments/RelationManagers/RatersRelationManager.php | Switches duplicate detection to email_hash and changes create logic for raters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
maheshmuralip
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rater email and name are encrypted in the database and an extra email_hash column prevents duplicates.
Also fixed some model relationships and tests.
Note: encrypted columns cannot be searchable or sortable. In Filament Raters table users can now only search by Subject's Academy ID. That should be enough since one subject will be unlikely to have more than a few raters.