alias = $alias; $this->company_id = $company_id; $this->locale = $locale ?: company($company_id)->locale; } /** * Execute the job. * * @return string */ public function handle() { $this->authorize(); event(new \App\Events\Module\Disabling($this->alias, $this->company_id)); $command = "module:disable {$this->alias} {$this->company_id} {$this->locale}"; $result = Console::run($command); if ($result !== true) { throw new \Exception($result); } } /** * Determine if this action is applicable. */ public function authorize(): void { if (! $this->moduleExists($this->alias)) { throw new \Exception("Module [{$this->alias}] not found."); } } }