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 FieldReference to Before and After Validation Attribute #345

Conversation

dtangdev
Copy link
Contributor

@dtangdev dtangdev commented Feb 2, 2023

    #[WithCast(DateTimeInterfaceCast::class)]
    #[Before(new FieldReference('end_at'))]
    public Carbon $start_at;

    #[WithCast(DateTimeInterfaceCast::class)]
    #[After(new FieldReference('start_at'))]
    public Carbon $end_at;

To prevent validation issues when the data is nested (inside a DataCollection for example)

@rubenvanassche
Copy link
Member

Thanks!

@rubenvanassche rubenvanassche merged commit 2b58d23 into spatie:main Feb 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants