-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Enhance Custom Rules: Introduce translatableExists and translatableUnique for Validating Translatable Attributes #406
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far looking okay - in addition to the requested changes please run the composer fix
command locally to fix all the style changes.
- Fix PHPDocs, and Code Style
All request changes fixed, and pushed. |
.gitignore
Outdated
@@ -4,3 +4,4 @@ | |||
/.phpunit.cache | |||
/build/ | |||
/coverage.clover | |||
.history |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into your global gitignore as it's not related to the project but your local environment.
https://sebastiandedeyne.com/setting-up-a-global-gitignore-file/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Tests seem to fail for Laravel 9 |
… InvokableRule interface instead of the new one introduced in Laravel 10. Future updates will accommodate the removal of Laravel 9 support.
Apologies, @Gummibeer, I hadn't realized the compatibility issue with Laravel 9. The code has been updated to accommodate Laravel 9, but it will require further refinement once Laravel 9 is no longer supported. |
Description:
Incorporating unique and existence validation for translatable attributes can be crucial for many projects. The current Laravel validation doesn't inherently support this functionality, prompting the need for custom solutions.
This pull request introduces two custom validation rules,
translatableExists
, andtranslatableUnique
, tailored specifically for validating translatable attributes. With these additions, developers gain the ability to ensure data integrity and uniqueness within multilingual datasets effortlessly.Changes:
Added
translatableExists
rule to validate the existence of translatable attributes.Introduced
translatableUnique
rule for enforcing uniqueness constraints on translatable fields.Purpose:
This enhancement empowers developers to perform comprehensive validation on translatable attributes, enhancing data validation capabilities within multilingual contexts. By providing these custom rules, we aim to streamline development workflows and promote best practices in data validation.
Benefits:
Facilitates validation of translatable attributes for existence and uniqueness.
Enhances data integrity and consistency within multilingual datasets.
Provides developers with versatile tools for enforcing validation rules tailored to translatable fields.
Usage:
Developers can now utilize the
translatableExists
andtranslatableUnique
rules in Laravel validation logic to ensure data integrity and uniqueness across multilingual attributes effortlessly.