Created
August 30, 2022 01:14
-
-
Save tderick/3532f6d164507824c9152466c8ee9635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function store(Request $request) | |
{ | |
$this->validate($request, [ | |
'name' => 'required', | |
'email' => 'required', | |
'message' => 'required', | |
'g-recaptcha-response' => 'required|recaptchav3:contact,0.5' | |
]); | |
$requestData = $request->all(); | |
$contact = Contact::create($requestData); | |
Mail::to(env("ADMIN_EMAIL"))->send(new ContactMail($contact)); # The code we've added | |
return redirect('contact')->with("status", "Your message has been sent"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment