public function getOtherInstall($plugin)
 {
     if (!is_dir(adminpanel_plugin_path($plugin))) {
         abort(404);
     }
     $result = $this->pluginService->store($plugin);
     if ($result === TRUE) {
         return redirect()->route('adminpanel.plugin.getIndex')->with('adminpanel_form', ['status' => 'success', 'message' => 'Plugin successfully installed']);
     }
     return redirect()->route('adminpanel.plugin.getIndex')->with('adminpanel_form', ['status' => 'warning', 'message' => $result]);
 }
Exemple #2
0
 function adminpanel_plugin_exists($directory_name)
 {
     return file_exists(adminpanel_plugin_path($directory_name));
 }
 protected function registerProviders($plugin_model)
 {
     //register only active plugins
     if (\Schema::hasTable('adminpanel_plugins')) {
         $plugins = $plugin_model->active();
         foreach ($plugins as $active) {
             //checks if service provider exists
             $plugin_provider = "Digitlimit\\Adminpanel\\Plugins\\{$active->name}\\Adminpanel{$active->name}ServiceProvider";
             if (!class_exists($plugin_provider)) {
                 continue;
             }
             //register plugin service provider
             $this->app->register($plugin_provider);
             //include plugin routes
             if (file_exists($plugin_route = adminpanel_plugin_path("{$active->name}/Http/routes.php"))) {
                 //include routes
                 include_once $plugin_route;
             }
             if (file_exists($plugin_api_route = adminpanel_plugin_path("{$active->name}/routes/api.php"))) {
                 //include api routes
                 include_once $plugin_api_route;
             }
             if (file_exists($plugin_web_route = adminpanel_plugin_path("{$active->name}/routes/web.php"))) {
                 //include web routes
                 include_once $plugin_web_route;
             }
             //register menus, dashboards, widgets
             $class = "Digitlimit\\Adminpanel\\Plugins\\{$active->name}\\Plugin";
             if (!class_exists($class)) {
                 continue;
             }
             //make plugin
             $plugin = app($class);
             //call register plugin sidebars
             if (method_exists($plugin, 'registerSidebar')) {
                 $sidebar = $plugin->registerSidebar();
                 $this->registerSidebar($sidebar);
             }
             //call register plugin dashboard
             if (method_exists($plugin, 'registerDashboard') && adminpanel_routeIs('adminpanel.dashboard.index')) {
                 $dashboard = $plugin->registerDashboard();
                 $this->registerDashboard($dashboard);
             }
             //call_user_func_array([$plugin, "registerDashboard"], []);
         }
     }
 }
Exemple #4
0
 /**
  * Extract plugin zip file to plugins directory
  *
  * @param $filename
  * @return bool|void
  */
 protected function extract($filename)
 {
     return $this->zip->extract(adminpanel_plugin_path($filename), adminpanel_plugin_path());
 }
 public function deleteOther($plugin)
 {
     return $this->file->deleteDirectory(adminpanel_plugin_path($plugin));
 }