Now the default smtp settings are taken from the .env file. To send a message I use the Mailable class in the controller:
Mail::to(Auth::user()->email)->send(new MailToClient(......));
But i want to use smtp settings from database:
Table "configs"
mail_host varchar(255);
mail_port varchar(255);
mail_username varchar(255);
mail_password varchar(255);
mail_encryption varchar(255);
1mail_address varchar(255);
I would advice against doing that, at least without encrypting the password for the smtp first.
It's usually easier to get into the database than the filesystem. Unless of course, you've haven't configured your document root properly and you can access your .env from the url.