My mailing functionality works by adding the configs on .env
file.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=passwordd
MAIL_FROM=info@text.com
MAIL_NAME=Info
But my problem is I don't know how to update this configs dynamically. I've try using the helper config()
but I can't see the SMTP values in config('app')
.
In case you're wondering why I want to do this is because the SMTP configs will come from the DB.
I hope this is clear, if not please let me know!
Thank you in advance!
Perhaps you can use the
Config::set
method, as answered here:https://stackoverflow.com/a/23438548/385402
but I think it would be better to use DB values directly before sending the email, I don't know if it makes sense that you store them into a config file at all if you already have them in the database.