Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Domain/Suspend.php
- This file was moved from src/app/Console/Commands/DomainSuspend.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\Domain; | ||||
use App\Console\Command; | |||||
use App\Domain; | use App\Domain; | ||||
use Illuminate\Console\Command; | |||||
class DomainSuspend extends Command | class Suspend extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'domain:suspend {domain}'; | protected $signature = 'domain:suspend {domain}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = 'Suspend a domain'; | protected $description = 'Suspend a domain'; | ||||
/** | /** | ||||
* Create a new command instance. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct() | |||||
{ | |||||
parent::__construct(); | |||||
} | |||||
/** | |||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$domain = Domain::where('namespace', $this->argument('domain'))->first(); | $domain = $this->getDomain($this->argument('domain')); | ||||
if (!$domain) { | if (!$domain) { | ||||
$this->error("Domain not found."); | |||||
return 1; | return 1; | ||||
} | } | ||||
$this->info("Found domain: {$domain->id}"); | |||||
$domain->suspend(); | $domain->suspend(); | ||||
} | } | ||||
} | } |