Skip to content

feat(validation): allow validation failures with messages#2196

Open
xHeaven wants to merge 1 commit into
tempestphp:3.xfrom
xHeaven:fix/validation-failed-messages
Open

feat(validation): allow validation failures with messages#2196
xHeaven wants to merge 1 commit into
tempestphp:3.xfrom
xHeaven:fix/validation-failed-messages

Conversation

@xHeaven

@xHeaven xHeaven commented Jun 26, 2026

Copy link
Copy Markdown
Member

Fixes #2194

@xHeaven xHeaven requested review from brendt and innocenzi as code owners June 26, 2026 11:08
use Tempest\Validation\HasErrorMessage;
use Tempest\Validation\Rule;

#[Attribute]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to make this not usable for validation (no attribute)? And perhaps using @internal or something?

Another tought: would an inline anonymous class fit here?

(Im assuming this is to not be "public")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better now? I wouldn't use an anonymous class - validation failures can be flashed into the session, and they should remain properly serializable.

@xHeaven xHeaven force-pushed the fix/validation-failed-messages branch from b1f21e4 to 163ed0d Compare June 26, 2026 17:45
@innocenzi innocenzi changed the title fix(validation): allow validation failures with messages feat(validation): allow validation failures with messages Jun 27, 2026
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.

Make ValidationFailed throwable without rules

3 participants