Add widgets to an infolist?

Is it possible to place widgets inside an infolist?
Solution:
```php public function tabs(Infolist $infolist): Infolist { return $infolist ->schema([...
Jump to solution
3 Replies
Proculair
Proculair9mo ago
I have a view like this:
<x-filament::page>
{{ $this->tabs }}
</x-filament::page>
<x-filament::page>
{{ $this->tabs }}
</x-filament::page>
And a method on the page like this:
public function tabs(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Label')
->tabs([
Tab::make(__('Zaken'))
->schema([
// TODO: add
]),
]),
]);
}
public function tabs(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make('Label')
->tabs([
Tab::make(__('Zaken'))
->schema([
// TODO: add
]),
]),
]);
}
I've found the solution 🥳
Solution
Proculair
Proculair9mo ago
public function tabs(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make()
->tabs([
Tab::make(__('Tab 1'))
->schema([
ViewEntry::make("WidgetClass")
->view("components.widget", [
"widget" =>
WidgetClass::class,
"properties" => []
]),
]),
]),
]);
}
public function tabs(Infolist $infolist): Infolist
{
return $infolist
->schema([
Tabs::make()
->tabs([
Tab::make(__('Tab 1'))
->schema([
ViewEntry::make("WidgetClass")
->view("components.widget", [
"widget" =>
WidgetClass::class,
"properties" => []
]),
]),
]),
]);
}
Proculair
Proculair9mo ago
components/widget.blade.php
@props(['widget', 'properties' => []])

@livewire($widget, $properties)
@props(['widget', 'properties' => []])

@livewire($widget, $properties)