How to Reset Laravel Admin Password directly from the Database

Laravel normally Hashes its passwords using Bcrypt so that its secure. This way, you cannot directly decrypt it, without knowing the correct password, nor can you directly type a password into the database to reset a users password. Such a password will not work.

To correctly set a password for a Laravel user from database, use these steps

1.Login to cPanel

2.Go to Terminal section and access your Laravel folder via SSH

3.Once inside the folder, type in this command to open a different console

[user@rbx106 public_html]$ php artisan tinker

4.You will view a console that starts with >>>

5.Type in the command below

user@rbx106 public_html]$ echo Hash::make('your-new-plaintext-password-here')

Replace your-new-plaintext-password-here with the actual password you want to use. This is in plain text and NOT hashed.

6. You should see output as below.

$2y$10$GTP5DRX5IBTH9iCikZV7zeKHZeRC9EHP28Hs2LaHBGC9oZkTaHKfW⏎

7.Copy the output and paste it under the password field in users table.

You may then login using your username and the password set above!

Was this article helpful?

Related Articles

Leave A Comment?