I followed this tutorial to create dynamic email settings stored on db.
The only problem is that the password is not encrypted. I would like to encrypt it before storing on db and decrypt it before using on MailServiceProvider.
I tried to use bcrypt but it can't be de-crypted. Any suggestions?
Thanks
see the docs for encryption: https://laravel.com/docs/8.x/encryption
encrypting
password:
$encrypted = crypt::encryptString($password);
//store this to database
decrypting
password:
$decrypted_password = crypt::decryptString($encrypted);
//use this for mailer settings
Note: don't forget to use namespace Illuminate\Support\Facades\Crypt;
in the controller
Additional Note for bcrypt: encryption-decryption is different than hashing, bcrypt is a hashing formula which can't be decrypted (one way process).