Skip to content
Discussion options

You must be logged in to vote

@bkuhl The field starts with a valid state by its nature. The required validation in this case just checks the value is passed in the request.

It sounds like you're trying to create a list of "are you sure you did this?" confirmations before running the action, but the user is allowed to ignore the list before submitting. Is that correct? If so, you could accomplish that like this:

BooleanGroup::make('Everything looks correct?')->options([
    'something' => 'Something',
    'else' => 'Something Else',
])->rules([
    function (string $attribute, mixed $value, Closure $fail) {
        $options = json_decode($value, true);
        $confirmedCount = count(array_filter($options, fn($val) => $v…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by crynobone
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #5385 on March 07, 2023 01:21.