Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Domain/SetWalletCommand.php
Show All 39 Lines | public function handle() | ||||
$wallet = $this->getWallet($this->argument('wallet')); | $wallet = $this->getWallet($this->argument('wallet')); | ||||
if (!$wallet) { | if (!$wallet) { | ||||
$this->error("Wallet not found."); | $this->error("Wallet not found."); | ||||
return 1; | return 1; | ||||
} | } | ||||
if ($domain->entitlement) { | if ($entitlement = $domain->entitlements()->first()) { | ||||
$this->error("Domain already assigned to a wallet: {$domain->entitlement->wallet->id}."); | $this->error("Domain already assigned to a wallet: {$entitlement->wallet->id}."); | ||||
return 1; | return 1; | ||||
} | } | ||||
$sku = Sku::withObjectTenantContext($domain)->where('title', 'domain-hosting')->first(); | $sku = Sku::withObjectTenantContext($domain)->where('title', 'domain-hosting')->first(); | ||||
Queue::fake(); // ignore LDAP for now (note: adding entitlements updates the domain) | Queue::fake(); // ignore LDAP for now (note: adding entitlements updates the domain) | ||||
Entitlement::create( | Entitlement::create( | ||||
Show All 11 Lines |