I have a site where user passwords are hashed using Laravel's Hash::make() function.
I now have a need to manually create user's directly in the DB (MySQL). Is there a way I can create the hashed password for the user using just raw SQL?
You can create the password that you want via php artisan tinker
:
php artisan tinker
.echo Hash::make('password')
;You will see the hashed password. You can do whatever you want with that password, even with sql query directly.
Not really, I'm afraid. Laravel uses Bcrypt, which isn't available in MySQL. In addition, it's a bad practice to do it in raw SQL, because the passwords might end up in server query logs. Sorry. :/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With