the most bizarre thing happened, someone fount out the smtp mail driver credentials from a Laravel project, which are stored in the .env
.
The credentials are used for a contact form. The .env
was in production and the debug was set to false APP_DEBUG=false
. The location of the .env
was never changed so it is not a public file.
Any suggestions how can one get the credentials? I am using re captcha to prevent spam mails.
Contact controller:
public function sendMail(SendContactMailRequest $request)
{
$email = FormEmail::whereId($request->department)->firstOrFail();
\Mail::send('emails.contact', [
'name' => $request->name,
'email' => $request->email,
'phone' => $request->phone,
'subject' => $request->subject,
'form_message' => $request->message
], function ($message) use ($request, $email) {
$message->from($request->email, $request->name);
$message->to($email->email)->subject($request->subject);
});
return redirect()->route('contact')->with('message', __('custom-form.success-message'));
}