Create new info list entry render the widget
I want to create the new infolist entry.
1 Reply
and render the widget for example :
i want render the new widget for example :
<?php
namespace App\Infolists\Components;
use App\Filament\Widgets\CompositorChart;
use Filament\Infolists\Components\Entry;
class InfoListWidget extends Entry
{
protected string $view = 'infolists.components.info-list-widget';
public function getWidgets(): array
{
return [
CompositorChart::class,
];
}
}
<?php
namespace App\Infolists\Components;
use App\Filament\Widgets\CompositorChart;
use Filament\Infolists\Components\Entry;
class InfoListWidget extends Entry
{
protected string $view = 'infolists.components.info-list-widget';
public function getWidgets(): array
{
return [
CompositorChart::class,
];
}
}
@php
dd($entry->getWidgets());
$widgetData = $this->getWidgetData();
@endphp
<x-dynamic-component :component="$getEntryWrapperView()" :entry="$entry">
<div>
<x-filament-widgets::widgets
:data="
[
...(property_exists($this, 'filters') ? ['filters' => $this->filters] : []),
...$widgetData,
]
"
:widgets="$entry->getWidgets()"
/>
</div>
</x-dynamic-component>
@php
dd($entry->getWidgets());
$widgetData = $this->getWidgetData();
@endphp
<x-dynamic-component :component="$getEntryWrapperView()" :entry="$entry">
<div>
<x-filament-widgets::widgets
:data="
[
...(property_exists($this, 'filters') ? ['filters' => $this->filters] : []),
...$widgetData,
]
"
:widgets="$entry->getWidgets()"
/>
</div>
</x-dynamic-component>