From b54c9b1ecc83402e85d6406c01c3a4c4e9994420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Thu, 11 Jun 2020 23:32:13 +0300 Subject: [PATCH] refactored module commands --- app/Abstracts/Commands/Module.php | 77 +++++++++++++ app/Console/Commands/UninstallModule.php | 53 +++++++++ app/Events/Install/UpdateCacheCleared.php | 22 ++++ app/Events/Module/{Deleted.php => Copied.php} | 2 +- app/Events/Module/Uninstalled.php | 26 +++++ app/Http/Controllers/Modules/Item.php | 103 ++++-------------- app/Listeners/Module/ClearCache.php | 45 ++++++++ app/Listeners/Module/FinishInstallation.php | 27 +++++ app/Providers/Event.php | 4 + app/Traits/Modules.php | 100 +++++++++-------- app/Utilities/Updater.php | 6 +- .../module/Commands/DeleteCommand.php | 68 +----------- .../module/Commands/DisableCommand.php | 70 ++++-------- .../module/Commands/EnableCommand.php | 70 ++++-------- .../module/Commands/InstallCommand.php | 73 ++----------- .../modules/item/documentation.blade.php | 2 +- 16 files changed, 395 insertions(+), 353 deletions(-) create mode 100644 app/Abstracts/Commands/Module.php create mode 100644 app/Console/Commands/UninstallModule.php create mode 100644 app/Events/Install/UpdateCacheCleared.php rename app/Events/Module/{Deleted.php => Copied.php} (96%) create mode 100644 app/Events/Module/Uninstalled.php create mode 100644 app/Listeners/Module/ClearCache.php create mode 100644 app/Listeners/Module/FinishInstallation.php diff --git a/app/Abstracts/Commands/Module.php b/app/Abstracts/Commands/Module.php new file mode 100644 index 000000000..15676eaf7 --- /dev/null +++ b/app/Abstracts/Commands/Module.php @@ -0,0 +1,77 @@ +alias = Str::kebab($this->argument('alias')); + $this->company_id = $this->argument('company'); + $this->locale = $this->argument('locale'); + + $this->module = module($this->alias); + } + + protected function changeRuntime() + { + $this->old_company_id = session('company_id'); + + session(['company_id' => $this->company_id]); + + app()->setLocale($this->locale); + + // Disable model cache + config(['laravel-model-caching.enabled' => false]); + } + + protected function revertRuntime() + { + session()->forget('company_id'); + + if (!empty($this->old_company_id)) { + session(['company_id' => $this->old_company_id]); + } + } + + protected function getModel() + { + $this->model = Model::companyId($this->company_id)->alias($this->alias)->first(); + + return $this->model; + } + + protected function createHistory($action) + { + if (empty($this->model)) { + return; + } + + ModuleHistory::create([ + 'company_id' => $this->company_id, + 'module_id' => $this->model->id, + 'category' => $this->module->get('category'), + 'version' => $this->module->get('version'), + 'description' => trans('modules.' . $action, ['module' => $this->alias]), + ]); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return [ + ['alias', InputArgument::REQUIRED, 'Module alias.'], + ['company', InputArgument::REQUIRED, 'Company ID.'], + ]; + } +} diff --git a/app/Console/Commands/UninstallModule.php b/app/Console/Commands/UninstallModule.php new file mode 100644 index 000000000..bef7098a9 --- /dev/null +++ b/app/Console/Commands/UninstallModule.php @@ -0,0 +1,53 @@ +prepare(); + + if (!$this->getModel()) { + $this->info("Module [{$this->alias}] not found."); + return; + } + + $this->changeRuntime(); + + // Delete db + $this->model->delete(); + + $this->createHistory('uninstalled'); + + event(new \App\Events\Module\Uninstalled($this->alias, $this->company_id)); + + // Delete files + $this->module->delete(); + + $this->revertRuntime(); + + $this->info("Module [{$this->alias}] uninstalled."); + } +} diff --git a/app/Events/Install/UpdateCacheCleared.php b/app/Events/Install/UpdateCacheCleared.php new file mode 100644 index 000000000..ccc74b4a1 --- /dev/null +++ b/app/Events/Install/UpdateCacheCleared.php @@ -0,0 +1,22 @@ +company_id = $company_id; + } +} diff --git a/app/Events/Module/Deleted.php b/app/Events/Module/Copied.php similarity index 96% rename from app/Events/Module/Deleted.php rename to app/Events/Module/Copied.php index 02f0e4893..6764baa4d 100644 --- a/app/Events/Module/Deleted.php +++ b/app/Events/Module/Copied.php @@ -4,7 +4,7 @@ namespace App\Events\Module; use Illuminate\Queue\SerializesModels; -class Deleted +class Copied { use SerializesModels; diff --git a/app/Events/Module/Uninstalled.php b/app/Events/Module/Uninstalled.php new file mode 100644 index 000000000..776c238f9 --- /dev/null +++ b/app/Events/Module/Uninstalled.php @@ -0,0 +1,26 @@ +alias = $alias; + $this->company_id = $company_id; + } +} diff --git a/app/Http/Controllers/Modules/Item.php b/app/Http/Controllers/Modules/Item.php index 38c9b6519..b4a5aa14b 100644 --- a/app/Http/Controllers/Modules/Item.php +++ b/app/Http/Controllers/Modules/Item.php @@ -38,7 +38,7 @@ class Item extends Controller $module = $this->getModule($alias); if (empty($module)) { - return redirect('apps/home')->send(); + return redirect()->route('apps.home.index')->send(); } if ($this->moduleExists($alias) && ($model = Module::alias($alias)->first())) { @@ -169,102 +169,39 @@ class Item extends Controller { $json = $this->uninstallModule($alias); - $module = Module::alias($alias)->first(); + if ($json['success']) { + $message = trans('modules.uninstalled', ['module' => $json['data']['name']]); - $data = [ - 'company_id' => session('company_id'), - 'module_id' => $module->id, - 'category' => $json['data']['category'], - 'version' => $json['data']['version'], - 'description' => trans('modules.uninstalled', ['module' => $json['data']['name']]), - ]; + flash($message)->success(); + } - ModuleHistory::create($data); - - $module->delete(); - - $message = trans('modules.uninstalled', ['module' => $json['data']['name']]); - - flash($message)->success(); - - return redirect('apps/' . $alias)->send(); - } - - public function update($alias) - { - $json = $this->updateModule($alias); - - $module = Module::alias($alias)->first(); - - $data = [ - 'company_id' => session('company_id'), - 'module_id' => $module->id, - 'category' => $json['data']['category'], - 'version' => $json['data']['version'], - 'description' => trans_choice('modules.updated', $json['data']['name']), - ]; - - ModuleHistory::create($data); - - $message = trans('modules.updated', ['module' => $json['data']['name']]); - - flash($message)->success(); - - return redirect('apps/' . $alias)->send(); + return redirect()->route('apps.app.show', $alias)->send(); } public function enable($alias) { $json = $this->enableModule($alias); - $module = Module::alias($alias)->first(); + if ($json['success']) { + $message = trans('modules.enabled', ['module' => $json['data']['name']]); - $data = [ - 'company_id' => session('company_id'), - 'module_id' => $module->id, - 'category' => $json['data']['category'], - 'version' => $json['data']['version'], - 'description' => trans('modules.enabled', ['module' => $json['data']['name']]), - ]; + flash($message)->success(); + } - $module->enabled = 1; - - $module->save(); - - ModuleHistory::create($data); - - $message = trans('modules.enabled', ['module' => $json['data']['name']]); - - flash($message)->success(); - - return redirect('apps/' . $alias)->send(); + return redirect()->route('apps.app.show', $alias)->send(); } public function disable($alias) { $json = $this->disableModule($alias); - $module = Module::alias($alias)->first(); + if ($json['success']) { + $message = trans('modules.disabled', ['module' => $json['data']['name']]); - $data = [ - 'company_id' => session('company_id'), - 'module_id' => $module->id, - 'category' => $json['data']['category'], - 'version' => $json['data']['version'], - 'description' => trans('modules.disabled', ['module' => $json['data']['name']]), - ]; + flash($message)->success(); + } - $module->enabled = 0; - - $module->save(); - - ModuleHistory::create($data); - - $message = trans('modules.disabled', ['module' => $json['data']['name']]); - - flash($message)->success(); - - return redirect('apps/' . $alias)->send(); + return redirect()->route('apps.app.show', $alias)->send(); } public function reviews($alias, Request $request) @@ -292,11 +229,11 @@ class Item extends Controller { $documentation = $this->getDocumentation($alias); - if (empty($documentation)) { - return redirect('apps/' . $alias)->send(); - } + $back = route('apps.app.show', $alias); - $back = 'apps/' . $alias; + if (empty($documentation)) { + return redirect()->route($back)->send(); + } return view('modules.item.documentation', compact('documentation', 'back')); } diff --git a/app/Listeners/Module/ClearCache.php b/app/Listeners/Module/ClearCache.php new file mode 100644 index 000000000..372c5fd7c --- /dev/null +++ b/app/Listeners/Module/ClearCache.php @@ -0,0 +1,45 @@ +company_id); + } + + /** + * Register the listeners for the subscriber. + * + * @param \Illuminate\Events\Dispatcher $dispatcher + */ + public function subscribe($dispatcher) + { + $events = [ + 'App\Events\Install\UpdateCacheCleared', + 'App\Events\Module\Copied', + 'App\Events\Module\Enabled', + 'App\Events\Module\Disabled', + 'App\Events\Module\Uninstalled', + ]; + + foreach ($events as $event) { + $dispatcher->listen($event, 'App\Listeners\Module\ClearCache@handle'); + } + } +} diff --git a/app/Listeners/Module/FinishInstallation.php b/app/Listeners/Module/FinishInstallation.php new file mode 100644 index 000000000..f1bcbeb8b --- /dev/null +++ b/app/Listeners/Module/FinishInstallation.php @@ -0,0 +1,27 @@ +alias); + + Artisan::call('migrate', ['--force' => true]); + + $this->attachDefaultModulePermissions($module); + } +} diff --git a/app/Providers/Event.php b/app/Providers/Event.php index 732e83143..3051a8b4f 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -73,6 +73,9 @@ class Event extends Provider 'App\Events\Menu\PortalCreated' => [ 'App\Listeners\Menu\AddPortalItems', ], + 'App\Events\Module\Installed' => [ + 'App\Listeners\Module\FinishInstallation', + ], ]; /** @@ -81,6 +84,7 @@ class Event extends Provider * @var array */ protected $subscribe = [ + 'App\Listeners\Module\ClearCache', 'App\Listeners\Report\AddDate', 'App\Listeners\Report\AddAccounts', 'App\Listeners\Report\AddCustomers', diff --git a/app/Traits/Modules.php b/app/Traits/Modules.php index 001dfa177..be29a8507 100644 --- a/app/Traits/Modules.php +++ b/app/Traits/Modules.php @@ -425,17 +425,11 @@ trait Modules File::copyDirectory($temp_path, $module_path); File::deleteDirectory($temp_path); - $data = [ - 'path' => $path, - 'name' => Str::studly($module->alias), - 'alias' => $module->alias, - ]; + event(new \App\Events\Module\Copied($module->alias, session('company_id'))); $company_id = session('company_id'); $locale = app()->getLocale(); - $this->clearModulesCache(); - $command = "module:install {$module->alias} {$company_id} {$locale}"; if (true !== $result = Console::run($command)) { @@ -454,29 +448,44 @@ trait Modules 'redirect' => route('apps.app.show', $module->alias), 'error' => false, 'message' => null, - 'data' => $data, + 'data' => [ + 'path' => $path, + 'name' => module($module->alias)->getName(), + 'alias' => $module->alias, + ], ]; } public function uninstallModule($alias) { $module = module($alias); + $name = $module->getName(); + $category = $module->get('category'); + $version = $module->get('version'); - $data = [ - 'name' => $module->getName(), - 'category' => $module->get('category'), - 'version' => $module->get('version'), - ]; + $company_id = session('company_id'); + $locale = app()->getLocale(); - $module->delete(); + $command = "module:uninstall {$alias} {$company_id} {$locale}"; - $this->clearModulesCache(); + if (true !== $result = Console::run($command)) { + return [ + 'success' => false, + 'error' => true, + 'message' => $result, + 'data' => null, + ]; + } return [ 'success' => true, 'error' => false, 'message' => null, - 'data' => $data, + 'data' => [ + 'name' => $name, + 'category' => $category, + 'version' => $version, + ], ]; } @@ -484,21 +493,29 @@ trait Modules { $module = module($alias); - $data = [ - 'name' => $module->getName(), - 'category' => $module->get('category'), - 'version' => $module->get('version'), - ]; + $company_id = session('company_id'); + $locale = app()->getLocale(); - $module->enable(); + $command = "module:enable {$alias} {$company_id} {$locale}"; - $this->clearModulesCache(); + if (true !== $result = Console::run($command)) { + return [ + 'success' => false, + 'error' => true, + 'message' => $result, + 'data' => null, + ]; + } return [ 'success' => true, 'error' => false, 'message' => null, - 'data' => $data, + 'data' => [ + 'name' => $module->getName(), + 'category' => $module->get('category'), + 'version' => $module->get('version'), + ], ]; } @@ -506,21 +523,29 @@ trait Modules { $module = module($alias); - $data = [ - 'name' => $module->getName(), - 'category' => $module->get('category'), - 'version' => $module->get('version'), - ]; + $company_id = session('company_id'); + $locale = app()->getLocale(); - $module->disable(); + $command = "module:disable {$alias} {$company_id} {$locale}"; - $this->clearModulesCache($alias); + if (true !== $result = Console::run($command)) { + return [ + 'success' => false, + 'error' => true, + 'message' => $result, + 'data' => null, + ]; + } return [ 'success' => true, 'error' => false, 'message' => null, - 'data' => $data, + 'data' => [ + 'name' => $module->getName(), + 'category' => $module->get('category'), + 'version' => $module->get('version'), + ], ]; } @@ -638,15 +663,4 @@ trait Modules return $data['query']['page']; } - - public function clearModulesCache() - { - if (config('module.cache.enabled')) { - Cache::forget(config('module.cache.key')); - } - - Cache::forget('apps.notifications'); - Cache::forget('apps.suggestions'); - Cache::forget('apps.installed.' . session('company_id')); - } } diff --git a/app/Utilities/Updater.php b/app/Utilities/Updater.php index b7e20e756..e9d04f9ee 100644 --- a/app/Utilities/Updater.php +++ b/app/Utilities/Updater.php @@ -2,6 +2,7 @@ namespace App\Utilities; +use App\Events\Install\UpdateCacheCleared; use App\Events\Install\UpdateCopied; use App\Events\Install\UpdateDownloaded; use App\Events\Install\UpdateUnzipped; @@ -22,9 +23,8 @@ class Updater { Cache::forget('updates'); Cache::forget('versions'); - Cache::forget('apps.notifications'); - Cache::forget('apps.suggestions'); - Cache::forget('apps.installed.' . session('company_id')); + + event(new UpdateCacheCleared(session('company_id'))); return true; } diff --git a/overrides/akaunting/module/Commands/DeleteCommand.php b/overrides/akaunting/module/Commands/DeleteCommand.php index 64b51c517..258d0618c 100644 --- a/overrides/akaunting/module/Commands/DeleteCommand.php +++ b/overrides/akaunting/module/Commands/DeleteCommand.php @@ -2,21 +2,16 @@ namespace Akaunting\Module\Commands; -use App\Models\Module\Module; -use App\Models\Module\ModuleHistory; -use Illuminate\Console\Command; -use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Str; -use Symfony\Component\Console\Input\InputArgument; +use App\Console\Commands\UninstallModule; -class DeleteCommand extends Command +class DeleteCommand extends UninstallModule { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'module:delete {alias} {company_id}'; + protected $signature = 'module:delete {alias} {company} {locale=en-GB}'; /** * The console command description. @@ -24,61 +19,4 @@ class DeleteCommand extends Command * @var string */ protected $description = 'Delete the specified module.'; - - /** - * Execute the console command. - * - * @return mixed - */ - public function handle() - { - $alias = Str::kebab($this->argument('alias')); - $company_id = $this->argument('company_id'); - - $model = Module::alias($alias)->companyId($company_id)->first(); - - if (!$model) { - $this->info("Module [{$alias}] not found."); - return; - } - - $module = module($alias); - $module->delete(); - - $model->enabled = 0; - $model->save(); - - // Add history - $data = [ - 'company_id' => $company_id, - 'module_id' => $model->id, - 'category' => $module->get('category', 'payment-method'), - 'version' => $module->get('version'), - 'description' => trans('modules.deleted', ['module' => $module->get('alias')]), - ]; - - ModuleHistory::create($data); - - // Trigger event - event(new \App\Events\Module\Deleted($alias, $company_id)); - - if (config('module.cache.enabled')) { - Cache::forget(config('module.cache.key')); - } - - $this->info("Module [{$alias}] deleted."); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return array( - array('alias', InputArgument::REQUIRED, 'Module alias.'), - array('company_id', InputArgument::REQUIRED, 'Company ID.'), - ); - } } diff --git a/overrides/akaunting/module/Commands/DisableCommand.php b/overrides/akaunting/module/Commands/DisableCommand.php index 74280c81e..fb0ce75bf 100644 --- a/overrides/akaunting/module/Commands/DisableCommand.php +++ b/overrides/akaunting/module/Commands/DisableCommand.php @@ -2,20 +2,16 @@ namespace Akaunting\Module\Commands; -use App\Models\Module\Module; -use App\Models\Module\ModuleHistory; -use Illuminate\Console\Command; -use Illuminate\Support\Str; -use Symfony\Component\Console\Input\InputArgument; +use App\Abstracts\Commands\Module; -class DisableCommand extends Command +class DisableCommand extends Module { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'module:disable {alias} {company_id}'; + protected $signature = 'module:disable {alias} {company} {locale=en-GB}'; /** * The console command description. @@ -31,52 +27,30 @@ class DisableCommand extends Command */ public function handle() { - $alias = Str::kebab($this->argument('alias')); - $company_id = $this->argument('company_id'); + $this->prepare(); - $model = Module::alias($alias)->companyId($company_id)->first(); - - if (!$model) { - $this->info("Module [{$alias}] not found."); + if (!$this->getModel()) { + $this->info("Module [{$this->alias}] not found."); return; } - if ($model->enabled == 1) { - $model->enabled = 0; - $model->save(); - - $module = module($alias); - - // Add history - $data = [ - 'company_id' => $company_id, - 'module_id' => $model->id, - 'category' => $module->get('category', 'payment-method'), - 'version' => $module->get('version'), - 'description' => trans('modules.disabled', ['module' => $module->get('alias')]), - ]; - - ModuleHistory::create($data); - - // Trigger event - event(new \App\Events\Module\Disabled($alias, $company_id)); - - $this->info("Module [{$alias}] disabled."); - } else { - $this->comment("Module [{$alias}] is already disabled."); + if ($this->model->enabled == 0) { + $this->comment("Module [{$this->alias}] is already disabled."); + return; } - } - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return array( - array('alias', InputArgument::REQUIRED, 'Module alias.'), - array('company_id', InputArgument::REQUIRED, 'Company ID.'), - ); + $this->changeRuntime(); + + // Update db + $this->model->enabled = 0; + $this->model->save(); + + $this->createHistory('disabled'); + + event(new \App\Events\Module\Disabled($this->alias, $this->company_id)); + + $this->revertRuntime(); + + $this->info("Module [{$this->alias}] disabled."); } } diff --git a/overrides/akaunting/module/Commands/EnableCommand.php b/overrides/akaunting/module/Commands/EnableCommand.php index 72d0fe080..6474d07cb 100644 --- a/overrides/akaunting/module/Commands/EnableCommand.php +++ b/overrides/akaunting/module/Commands/EnableCommand.php @@ -2,20 +2,16 @@ namespace Akaunting\Module\Commands; -use App\Models\Module\Module; -use App\Models\Module\ModuleHistory; -use Illuminate\Console\Command; -use Illuminate\Support\Str; -use Symfony\Component\Console\Input\InputArgument; +use App\Abstracts\Commands\Module; -class EnableCommand extends Command +class EnableCommand extends Module { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'module:enable {alias} {company_id}'; + protected $signature = 'module:enable {alias} {company} {locale=en-GB}'; /** * The console command description. @@ -31,52 +27,30 @@ class EnableCommand extends Command */ public function handle() { - $alias = Str::kebab($this->argument('alias')); - $company_id = $this->argument('company_id'); + $this->prepare(); - $model = Module::alias($alias)->companyId($company_id)->first(); - - if (!$model) { - $this->info("Module [{$alias}] not found."); + if (!$this->getModel()) { + $this->info("Module [{$this->alias}] not found."); return; } - if ($model->enabled == 0) { - $model->enabled = 1; - $model->save(); - - $module = module($alias); - - // Add history - $data = [ - 'company_id' => $company_id, - 'module_id' => $model->id, - 'category' => $module->get('category', 'payment-method'), - 'version' => $module->get('version'), - 'description' => trans('modules.enabled', ['module' => $module->get('alias')]), - ]; - - ModuleHistory::create($data); - - // Trigger event - event(new \App\Events\Module\Enabled($alias, $company_id)); - - $this->info("Module [{$alias}] enabled."); - } else { - $this->comment("Module [{$alias}] is already enabled."); + if ($this->model->enabled == 1) { + $this->comment("Module [{$this->alias}] is already enabled."); + return; } - } - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return array( - array('alias', InputArgument::REQUIRED, 'Module alias.'), - array('company_id', InputArgument::REQUIRED, 'Company ID.'), - ); + $this->changeRuntime(); + + // Update db + $this->model->enabled = 1; + $this->model->save(); + + $this->createHistory('enabled'); + + event(new \App\Events\Module\Enabled($this->alias, $this->company_id)); + + $this->revertRuntime(); + + $this->info("Module [{$this->alias}] enabled."); } } diff --git a/overrides/akaunting/module/Commands/InstallCommand.php b/overrides/akaunting/module/Commands/InstallCommand.php index 870f3a5b5..539eaec2a 100644 --- a/overrides/akaunting/module/Commands/InstallCommand.php +++ b/overrides/akaunting/module/Commands/InstallCommand.php @@ -2,18 +2,11 @@ namespace Akaunting\Module\Commands; -use App\Models\Module\Module; -use App\Models\Module\ModuleHistory; -use App\Traits\Permissions; -use Illuminate\Console\Command; -use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Str; -use Symfony\Component\Console\Input\InputArgument; +use App\Abstracts\Commands\Module; +use App\Models\Module\Module as Model; -class InstallCommand extends Command +class InstallCommand extends Module { - use Permissions; - /** * The name and signature of the console command. * @@ -35,65 +28,23 @@ class InstallCommand extends Command */ public function handle() { - $alias = Str::kebab($this->argument('alias')); - $company_id = $this->argument('company'); - $locale = $this->argument('locale'); + $this->prepare(); - $old_company_id = session('company_id'); + $this->changeRuntime(); - session(['company_id' => $company_id]); - - app()->setLocale($locale); - - $module = module($alias); - - $model = Module::create([ - 'company_id' => $company_id, - 'alias' => $alias, + // Create db + $this->model = Model::create([ + 'company_id' => $this->company_id, + 'alias' => $this->alias, 'enabled' => '1', ]); - ModuleHistory::create([ - 'company_id' => $company_id, - 'module_id' => $model->id, - 'category' => $module->get('category', 'payment-method'), - 'version' => $module->get('version'), - 'description' => trans('modules.installed', ['module' => $alias]), - ]); + $this->createHistory('installed'); - if (config('module.cache.enabled')) { - Cache::forget(config('module.cache.key')); - } + event(new \App\Events\Module\Installed($this->alias, $this->company_id)); - // Disable model cache during installation - config(['laravel-model-caching.enabled' => false]); - - // Update database - $this->call('migrate', ['--force' => true]); - - event(new \App\Events\Module\Installed($alias, $company_id)); - - $this->attachDefaultModulePermissions($module); - - session()->forget('company_id'); - - if (!empty($old_company_id)) { - session(['company_id' => $old_company_id]); - } + $this->revertRuntime(); $this->info('Module installed!'); } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return array( - array('alias', InputArgument::REQUIRED, 'Module alias.'), - array('company_id', InputArgument::REQUIRED, 'Company ID.'), - ); - } } diff --git a/resources/views/modules/item/documentation.blade.php b/resources/views/modules/item/documentation.blade.php index 61b5ee508..8b6060259 100644 --- a/resources/views/modules/item/documentation.blade.php +++ b/resources/views/modules/item/documentation.blade.php @@ -22,7 +22,7 @@