Created
March 15, 2018 08:30
-
-
Save ganeshaampuh/ceb35fd8b03ec766167e847b41d9cc6e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| namespace App\Http\Controllers; | |
| use App\Mail\ContactUs; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Mail; | |
| use App\Models\ContactUs as Contact; | |
| class ContactController extends Controller | |
| { | |
| public function store(Request $request) | |
| { | |
| if ($request->ajax()) { | |
| $data = $request->all(); | |
| $mail = Mail::to('contact@telonlang.com')->send(new ContactUs($data)); | |
| $mailtodb = Contact::create($data); | |
| return response()->json(['status' => 'success','msg' => 'Mail has been Sent']); | |
| } else { | |
| return 'no'; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment