I've got an existing users table for my website and am rebuilding the entire site in Laravel. I'm struggling with moving the data from the old users table to Laravel's users table. The problem is that the old table's password field isn't hashed and Laravel's is. I did the following and it didn't work.
INSERT INTO users(name,
email,
password)
SELECT old_users.Username,
old_users.Email,
MD5(old_users.Password)
FROM old_users
I also just moved them without worrying about the hashing. That didn't work either.
Suggestions?
MD5 is not a secure method of hashing passwords, and Laravel doesn't use it. Instead it uses Bcrypt (http://laravel.com/docs/5.0/hashing).
Assuming your passwords are currently stored un-encrypted, I would suggest instead of directly using SQL, you write your script in Laravel, to handle the transfer of users into the new table, and use the Hash::make function (see the link above) to encrypt your passwords using Bcrypt.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community