Page MenuHomePhorge

RestoreCommand.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

RestoreCommand.php

<?php
namespace App\Console\Commands\Domain;
use App\Console\Command;
use Illuminate\Support\Facades\DB;
class RestoreCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'domain:restore {domain}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Restore (undelete) a domain';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$domain = $this->getDomain($this->argument('domain'), true);
if (!$domain) {
$this->error("Domain not found.");
return 1;
}
if (!$domain->trashed()) {
$this->error("The domain is not yet deleted.");
return 1;
}
$wallet = $domain->wallet();
if ($wallet && !$wallet->owner) {
$this->error("The domain owner is deleted.");
return 1;
}
DB::beginTransaction();
$domain->restore();
DB::commit();
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Apr 4, 9:41 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823507
Default Alt Text
RestoreCommand.php (1 KB)

Event Timeline