hash = $hash; } public function handle(): void { $email = $this->argument('email'); /** @var User|null $user */ $user = $email ? User::where('email', $email)->first() : User::where('is_admin', true)->first(); if (!$user) { $this->error('The user account cannot be found.'); return; } $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! 👌'); } }