Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Domain/SetWallet.php
- This file was moved from src/app/Console/Commands/DomainSetWallet.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\Domain; | ||||
use App\Console\Command; | |||||
use App\Entitlement; | use App\Entitlement; | ||||
use App\Domain; | use App\Domain; | ||||
use App\Sku; | use App\Sku; | ||||
use App\Wallet; | use App\Wallet; | ||||
use Illuminate\Console\Command; | |||||
use Illuminate\Support\Facades\Queue; | use Illuminate\Support\Facades\Queue; | ||||
class DomainSetWallet extends Command | class SetWallet 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:set-wallet {domain} {wallet}'; | protected $signature = 'domain:set-wallet {domain} {wallet}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = "Assign a domain to a wallet."; | protected $description = "Assign a domain to a wallet."; | ||||
/** | /** | ||||
* 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."); | $this->error("Domain not found."); | ||||
return 1; | return 1; | ||||
} | } | ||||
$wallet = Wallet::find($this->argument('wallet')); | $wallet = Wallet::find($this->argument('wallet')); | ||||
Show All 25 Lines |