fix(console): handle missing root user in password reset command
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user