execute(new UserAccountData( name: (string) $this->argument('name'), email: (string) $this->argument('email'), role: Role::Admin, )); } catch (DomainException $exception) { $this->components->error($exception->getMessage()); return self::FAILURE; } if ($created->setupLink->emailSent) { $this->components->info('Admin created. A link for setting the password was emailed to '.$this->argument('email').'.'); } else { $this->components->warn('Admin created, but the set-password email could not be sent (see the log).'); } $this->components->twoColumnDetail('Set-password link', $created->setupLink->url); return self::SUCCESS; } }