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

Setting default values with radio #15

Open
cemkoker opened this issue Nov 2, 2024 · 1 comment
Open

Setting default values with radio #15

cemkoker opened this issue Nov 2, 2024 · 1 comment

Comments

@cemkoker
Copy link

cemkoker commented Nov 2, 2024

Trying to set the default values but somehow it doesn't work:

`
Matrix::make('protein_consumption')
->formatStateUsing(fn() => [
'red_meat' => ['0' => true],
'white_meat' => ['0' => true],
'fish' => ['0' => true],
'eggs' => ['0' => true],
'offal' => ['0' => true],
'deli_meats' => ['0' => true],

                    ])
                    ->label('Protéines')
                    ->asRadio()
                    ->columnData([
                        '0' => '0',
                        '1-2' => '1-2',
                        '3-4' => '3-4',
                        '5-6' => '5-6',
                        '7+' => '7+'
                    ])
                    ->rowData([
                        'red_meat' => 'Viande rouge',
                        'white_meat' => 'Viande blanche',
                        'fish' => 'Poisson',
                        'eggs' => 'Œufs',
                        'offal' => 'Abats',
                        'deli_meats' => 'Charcuterie',
                    ]),

`

what am I doing wrong here ?

@atmonshi
Copy link
Member

sorry for the delay.

can you check if this works
#6 (comment)

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

No branches or pull requests

2 participants