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; } $this->components->info('Admin created. A link for setting the password was emailed to '.$this->argument('email').'.'); if (config('mail.default') === 'log') { $this->components->warn('MAIL_MAILER=log: find the link in storage/logs/laravel.log.'); } return self::SUCCESS; } }