/** * Normalize widget input. * * @param DashboardBuilder $builder */ public function normalize(DashboardBuilder $builder) { $widgets = $builder->getWidgets(); foreach ($widgets as &$widget) { /** * If the widget is a a string and there is no slug * then use the widget as the widget parameter. */ if (is_string($widget)) { $widget = compact('widget'); } } $builder->setWidgets($widgets); }
/** * Resolve the dashboard widgets. * * @param DashboardBuilder $builder */ public function resolve(DashboardBuilder $builder) { $this->resolver->resolve($builder->getWidgets(), compact('builder')); }