added install request
This commit is contained in:
@ -3,10 +3,13 @@
|
||||
namespace App\Jobs\Install;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Traits\Modules;
|
||||
use App\Utilities\Console;
|
||||
|
||||
class DisableModule extends Job
|
||||
{
|
||||
use Modules;
|
||||
|
||||
protected $alias;
|
||||
|
||||
protected $company_id;
|
||||
@ -34,6 +37,8 @@ class DisableModule extends Job
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->authorize();
|
||||
|
||||
$command = "module:disable {$this->alias} {$this->company_id} {$this->locale}";
|
||||
|
||||
$result = Console::run($command);
|
||||
@ -42,4 +47,14 @@ class DisableModule extends Job
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user