From c004d7e50ef1d18feeb3f2955001d8f6d3fc7b2d Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sat, 4 Nov 2023 14:36:36 +0300 Subject: [PATCH] support radio and checkbox --- resources/views/components/matrix-choice.blade.php | 5 ++++- src/Components/Matrix.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/views/components/matrix-choice.blade.php b/resources/views/components/matrix-choice.blade.php index 480486e..986efee 100644 --- a/resources/views/components/matrix-choice.blade.php +++ b/resources/views/components/matrix-choice.blade.php @@ -22,11 +22,14 @@ {{ $rowValue }} @foreach($columnData as $columnKey => $columnValue) + @php + $supStatPath = ($pilColor === 'radio') ? $statePath.'.'.$rowKey : $statePath.'.'.$rowKey.'.'.$columnKey ; + @endphp rules([ function () { return function (string $attribute, mixed $value, Closure $fail) { - if (blank($value)) { + if (blank($value) || count($this->getRowData()) !== count($value)) { $fail(__('required a selection for each row')); } foreach ($value as $val) {