Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignoreRecord attribute to unique validation rule for ticket_prefix in update of Project model. #75

Closed
josefo727 opened this issue Apr 17, 2023 · 1 comment
Assignees

Comments

@josefo727
Copy link
Contributor

josefo727 commented Apr 17, 2023

Added 'ignoreRecord' attribute to the 'unique' validation rule for 'ticket_prefix' when updating a project.

Currently in the file app/Filament/Resources/ProjectResource.php there is a unique validation rule

->unique(Project::class, column: 'ticket_prefix')

that prevents updating a Project because the prefix matches one in the database. The solution is to ignore the Project itself for this rule.

->unique(Project::class, column: 'ticket_prefix', ignoreRecord: true)

This solves the issue. I tried to create a branch with the solution to create a PR, but I do not have the necessary permissions to do so. Therefore, I am presenting the problem and the solution to you.

Thank you very much.

@mihaisolomon
Copy link
Collaborator

Resolved on this PR: #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants