Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/DomainRestore.php
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands; | ||||
use Illuminate\Console\Command; | use App\Console\Command; | ||||
use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||
class DomainRestore extends Command | class DomainRestore extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
Show All 9 Lines | class DomainRestore extends Command | ||||
/** | /** | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$domain = \App\Domain::withTrashed()->where('namespace', $this->argument('domain'))->first(); | $domain = $this->getDomain($this->argument('domain'), true); | ||||
if (!$domain) { | if (!$domain) { | ||||
$this->error("Domain not found."); | $this->error("Domain not found."); | ||||
return 1; | return 1; | ||||
} | } | ||||
if (!$domain->trashed()) { | if (!$domain->trashed()) { | ||||
$this->error("The domain is not yet deleted."); | $this->error("The domain is not yet deleted."); | ||||
Show All 15 Lines |