fix(console): handle missing root user in password reset command

This commit is contained in:
Andras Bacsai
2025-03-24 18:00:31 +01:00
parent e7f32a1c44
commit cef4596011
3 changed files with 7 additions and 2 deletions

View File

@@ -40,6 +40,11 @@ class RootResetPassword extends Command
$this->info('Updating root password...');
try {
$user = User::find(0);
if (! $user) {
$this->error('Root user not found.');
return;
}
$user->update(['password' => Hash::make($password)]);
$this->info('Root password updated successfully.');
} catch (\Exception $e) {