protected function getHeaderWidgets(): array
{
return $this->page->widgets->filter(function ($widget) {
return $widget->pivot->position === 'top' || $widget->pivot->position === null;
})->map(function ($widget) {
if (method_exists($widget->class, 'make')) {
return $widget->class::setSort($widget->pivot->order)->make([
'width' => $widget->pivot->width,
]);
}
return null;
})->filter()->toArray();
}
protected function getHeaderWidgets(): array
{
return $this->page->widgets->filter(function ($widget) {
return $widget->pivot->position === 'top' || $widget->pivot->position === null;
})->map(function ($widget) {
if (method_exists($widget->class, 'make')) {
return $widget->class::setSort($widget->pivot->order)->make([
'width' => $widget->pivot->width,
]);
}
return null;
})->filter()->toArray();
}