Merge pull request #13191 from tanthammar/nested-validation-attributes

Fix recursive validation attributes
This commit is contained in:
Dan Harrin
2024-06-11 15:19:44 +01:00
committed by GitHub
3 changed files with 12 additions and 2 deletions
@@ -45,4 +45,11 @@ trait HasNestedRecursiveValidationRules
return $rules;
}
public function dehydrateValidationAttributes(array &$attributes): void
{
parent::dehydrateValidationAttributes($attributes);
$attributes["{$this->getStatePath()}.*"] = $this->getValidationAttribute();
}
}
@@ -13,7 +13,8 @@ export default function table() {
livewireId: null,
init: function () {
this.livewireId = this.$root.closest('[wire\\:id]').attributes['wire:id'].value
this.livewireId =
this.$root.closest('[wire\\:id]').attributes['wire:id'].value
this.$wire.$on('deselectAllTableRecords', () =>
this.deselectAllRecords(),
@@ -494,7 +494,9 @@
x-bind:class="{
'hidden':
{{ $group?->isCollapsible() ? 'true' : 'false' }} &&
isGroupCollapsed({{ \Illuminate\Support\Js::from($recordGroupTitle) }}),
isGroupCollapsed(
{{ \Illuminate\Support\Js::from($recordGroupTitle) }},
),
{{ ($contentGrid ? '\'bg-gray-50 dark:bg-white/10 dark:ring-white/20\'' : '\'bg-gray-50 dark:bg-white/5 before:absolute before:start-0 before:inset-y-0 before:w-0.5 before:bg-primary-600 dark:before:bg-primary-500\'') . ': isRecordSelected(\'' . $recordKey . '\')' }},
{{ $contentGrid ? '\'bg-white dark:bg-white/5 dark:ring-white/10\': ! isRecordSelected(\'' . $recordKey . '\')' : '\'\':\'\'' }},
}"