argument('email'); /** @var User|null $user */ $user = $email ? User::query()->where('email', $email)->first() : User::query()->where('is_admin', true)->first(); if (!$user) { $this->error('The user account cannot be found.'); return self::FAILURE; } $this->comment("Changing the user's password (ID: $user->id, email: $user->email)"); $user->password = $this->hash->make($this->askForPassword()); $user->save(); $this->comment('Alrighty, the new password has been saved. Enjoy! 👌'); return self::SUCCESS; } }