Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Job/DomainCreate.php
<?php | <?php | ||||
namespace App\Console\Commands\Job; | namespace App\Console\Commands\Job; | ||||
use App\Console\Command; | |||||
use App\Domain; | use App\Domain; | ||||
use Illuminate\Console\Command; | |||||
class DomainCreate extends Command | class DomainCreate extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'job:domaincreate {domain}'; | protected $signature = 'job:domaincreate {domain}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = "Execute the DomainCreate job (again)."; | protected $description = "Execute the DomainCreate job (again)."; | ||||
/** | /** | ||||
* 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) { | ||||
return 1; | return 1; | ||||
} | } | ||||
$job = new \App\Jobs\Domain\CreateJob($domain->id); | $job = new \App\Jobs\Domain\CreateJob($domain->id); | ||||
$job->handle(); | $job->handle(); | ||||
} | } | ||||
} | } |