'StaticPages']); Artisan::call('install-module', ['name' => 'ContactForm']); } catch (\Exception $e) { // } $area = WidgetArea::create(['name' => 'Top menu', 'code' => 'topMenu', 'deletable' => 0]); $widget = Widget::create([ 'widget_type_handler' => OnePageMenu::class, 'name' => 'Menu', 'settings' => '{"containerClass": null}', 'deletable' => 0 ]); // bind widget with widget area WidgetInWidgetArea::create(['widget_id' => $widget->id, 'widget_area_id' => $area->id, 'position' => 1]); } /** * Get list of registered templates and supported modules. * * Returned array is expected to be array of arrays with following items: module, namespace and templateName. * Example: * return [ * ['module' => 'Article', 'templateName' => 'article::template.name'] * ]; * * When no "namespace" is specified, value strtolower(module) is used instaed. * * @return array */ public static function getPublicTemplatePaths() { return [ [ 'module' => 'StaticPages', 'templateName' => 'staticpages::adminMenu.templatePath' ], [ 'module' => 'ContactForm', 'templateName' => 'contactform::adminMenu.templatePath' ] ]; } public static function uninstall(Module $template) { parent::uninstall($template); WidgetArea::where('code', 'topMenu')->delete(); } }