Skip to content

Commit

Permalink
Merge pull request #10054 from filamentphp/fix/widget-key
Browse files Browse the repository at this point in the history
fix: Widget key
  • Loading branch information
danharrin authored Dec 3, 2023
2 parents f47bb4c + 7938a08 commit 7e73c35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class="flex flex-col gap-y-4"
@endphp

@if ($managers[$activeManager] instanceof \Filament\Resources\RelationManagers\RelationGroup)
@foreach ($managers[$activeManager]->ownerRecord($ownerRecord)->pageClass($pageClass)->getManagers() as $groupedManager)
@foreach ($managers[$activeManager]->ownerRecord($ownerRecord)->pageClass($pageClass)->getManagers() as $groupedManagerKey => $groupedManager)
@php
$normalizedGroupedManagerClass = $normalizeRelationManagerClass($groupedManager);
@endphp

@livewire(
$normalizedGroupedManagerClass,
[...$managerLivewireProperties, ...(($groupedManager instanceof \Filament\Resources\RelationManagers\RelationManagerConfiguration) ? [...$groupedManager->relationManager::getDefaultProperties(), ...$groupedManager->properties] : $groupedManager::getDefaultProperties())],
key($normalizedGroupedManagerClass),
key("{$normalizedGroupedManagerClass}-{$groupedManagerKey}"),
)
@endforeach
@else
Expand Down
10 changes: 7 additions & 3 deletions packages/widgets/resources/views/components/widgets.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
};
@endphp

@foreach ($widgets as $key => $widget)
@foreach ($widgets as $widgetKey => $widget)
@php
$widgetClass = $normalizeWidgetClass($widget);
@endphp

@livewire(
$normalizeWidgetClass($widget),
$widgetClass,
[...(($widget instanceof \Filament\Widgets\WidgetConfiguration) ? [...$widget->widget::getDefaultProperties(), ...$widget->properties] : $widget::getDefaultProperties()), ...$data],
key($key),
key("{$widgetClass}-{$widgetKey}"),
)
@endforeach
</x-filament::grid>

0 comments on commit 7e73c35

Please sign in to comment.