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