Home > database >  Change the Hash password in laravel using Phpmyadmin
Change the Hash password in laravel using Phpmyadmin

Time:11-07

I use Hash::make($req->pass); to login in Laravel. Now I forgot the password. Can I change the password by editing PHPMyAdmin? Is there any PHPMyadmin function to change the Bcrypt?

For eg. To change the password stored in MD5, I can change it by using MD5 function. And it works fine for all WordPress logins.

Thanks in Advance

CodePudding user response:

One way to change the password manually is to get the value from

$pw=Hash::make('yourpassword');

to a variable and copy that value into users table password field.

CodePudding user response:

I would use Tinker to achieve this:

php artisan tinker

$user = App/Models/User()::find(/* user_id */);

$user->password = Hash::make('your new password here');

$user->save();

// You should receive a "true" if the update is successful. 
// This can all be done via the command line.

You can also (for the sake of answering your question) just output the password from the route file:

Route::get('generate-password', function () {
  return Hash::make('your new password');
})

visit the '/generate-password' url, copy that password, then paste it into PHPMyAdmin

  • Related