You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class HomeController extends Controller
|
||
|
{
|
||
|
public function contact(Request $request){
|
||
|
|
||
|
// $contact = new Contact();
|
||
|
$subject = 'Contact Enquiry';
|
||
|
// $check = '';
|
||
|
// if(isset($request['firstname'])){
|
||
|
// $subject = 'Quick Enquiry';
|
||
|
// $check = '1';
|
||
|
// }
|
||
|
// $name = ($request['firstname'] != null) ? ($request['firstname'].' '.$request['lastname']) : $request['fullname'] ;
|
||
|
|
||
|
// $contact->fullname = $name;
|
||
|
// $contact->email = $request['email'];
|
||
|
// $contact->phone = $request['phone'];
|
||
|
// $contact->message = $request['message'];
|
||
|
|
||
|
// $contact->save();
|
||
|
|
||
|
// dispatch(function() use ($check,$subject, $contact) {
|
||
|
\Mail::send('contact_mail', array(
|
||
|
|
||
|
'full_name' =>$request['fname'],
|
||
|
|
||
|
'email' =>$request['email'],
|
||
|
|
||
|
'phone' =>$request['mobile'],
|
||
|
|
||
|
'job_title' =>$request['job_title'],
|
||
|
|
||
|
'contact_message' =>$request['message'],
|
||
|
|
||
|
'subject' =>$subject
|
||
|
|
||
|
|
||
|
), function($message) use ($subject){
|
||
|
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback';
|
||
|
$message->subject($subject);
|
||
|
// $message->to('info@agilityhomecare.com.au', 'AgilityHomeCare')->subject($subject);
|
||
|
$message->to('info@extratechs.com.au', 'Extratech')->subject($subject);
|
||
|
|
||
|
|
||
|
});
|
||
|
// });
|
||
|
// return redirect()->back()->with(['msg' => 'Successfully submitted.']);
|
||
|
return redirect()->back()->with(['msg' => 'Thank you for your interest. We will get back to you soon.','status' =>'Ok'],200);
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|