protected function init($slug) { $this->plugin = Plugin::where('slug', $slug)->first(); if ($this->plugin == null) { return false; } return true; }
private function getPluginRoutes() { $plugins = Plugin::all(); $results = []; foreach ($plugins as $plugin) { $routes = json_decode($plugin->routes); if (isset($routes->admin)) { foreach ($routes->admin as $title => $route) { $results[$title] = $route; } } } return $results; }
public function doUninstalPlugin($id) { $plugin = Plugin::find($id); $this->deletePlugin($plugin->slug); $plugin->delete(); return redirect()->route('ct_admin_plugins'); }