Closed josefo727 closed 1 year ago
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.
Resolved on this PR: https://github.com/devaslanphp/project-management/pull/76
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.