Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/UserDomains.php
- This file was copied to src/app/Console/Commands/WalletGetDiscount.php.
Show All 36 Lines | class UserDomains extends Command | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$user = User::where('email', $this->argument('userid'))->first(); | $user = User::where('email', $this->argument('userid'))->first(); | ||||
$this->info("Found user: {$user->id}"); | if (!$user) { | ||||
return 1; | |||||
} | |||||
foreach ($user->domains() as $domain) { | foreach ($user->domains() as $domain) { | ||||
$this->info("Domain: {$domain->namespace}"); | $this->info("{$domain->namespace}"); | ||||
} | } | ||||
} | } | ||||
} | } |