/** * @param $instance AbstractPlugin * @param $name */ public function afterBooting($instance, $name) { if (!$this->manager->isInstalled($instance->namespace)) { return; } if ($menu = $instance->getMenu()) { Artificer::addMenu($menu); } $this->addAssets($instance); }
protected function handleResources($instance) { $instance->resources = $instance->resources(new ResourceCollector(app(), get_class($instance))); $this->getEventDispatcher()->listen('extender.before.install.' . $instance->namespace, function () use($instance) { $resourceInstaller = $this->getResourceInstaller($instance); $resourceInstaller->install(); // loadDefered after installation $resourceInstaller->loadDefered(); if (method_exists($instance, 'install')) { $instance->install(); } }); $this->getEventDispatcher()->listen('extender.before.uninstall.' . $instance->namespace, function () use($instance) { $this->getResourceInstaller($instance)->uninstall(); if (method_exists($instance, 'uninstall')) { $instance->uninstall(); } }); if ($this->manager->isInstalled($instance->namespace)) { $this->getResourceInstaller($instance)->loadDefered(); } }