public function getSubscribes() { if ($this->subscribes == null) { $this->subscribes = $this->model->subscribes()->get(); } return $this->subscribes; }
/** * to synchronise plugins only available in plugin directory * but not in database * * @return PluginManager */ public function sync() { $complete_collection = $this->getCompleteCollection(); foreach ($complete_collection as $plugin) { /** @var $plugin PluginBootstrap */ /** @var $model Plugin */ $plugin_data = ['namespace' => $plugin->getNamespace(), 'source' => $plugin->getSource(), 'name' => $plugin->getName(), 'version' => $plugin->getVersion(), 'author' => $plugin->getAuthor(), 'copyright' => $plugin->getCopyright(), 'license' => $plugin->getLicense(), 'description' => $plugin->getDescription(), 'link' => $plugin->getLink()]; if (!($model = Plugin::where('namespace', $plugin->getNamespace())->first())) { $model = Plugin::create($plugin_data); } else { $model->update($plugin_data); } $plugin->setModel($model); $this->pluginCollection->registerPlugin($plugin); } return $this; }