Files
coreality-inc/app/Http/Controllers/SupportTechnicalController.php
ericli1018 6dfe3e0677 release
2025-06-13 12:24:35 +08:00

55 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use \App\Http\Requests\SupportTechnicalRequest;
use Carbon\Carbon;
use Illuminate\Support\Facades\Mail;
use App\Mail\CustomerServiceMail;
class SupportTechnicalController extends Controller
{
public function index()
{
return view('support-technical');
}
public function indexPost(SupportTechnicalRequest $request)
{
\App\Models\SupportTechnical::insert([
'name_first' => $request->input('name_first'),
'name_last' => $request->input('name_last'),
'company_name' => $request->input('company_name'),
'job_title' => $request->input('job_title'),
'email' => $request->input('email'),
'phone' => $request->input('phone'),
'contry' => $request->input('contry'),
'comments' => $request->input('comments'),
'created_at' => Carbon::now(),
]);
try
{
$data = 'First Name: ' . $request->input('name_first') . "\n";
$data .= 'Last Name: ' . $request->input('name_last') . "\n";
$data .= 'Company Name: ' . $request->input('company_name') . "\n";
$data .= 'Job Title: ' . $request->input('job_title') . "\n";
$data .= 'Email: ' . $request->input('email') . "\n";
$data .= 'Phone: ' . $request->input('phone') . "\n";
$data .= 'Contry: ' . $request->input('contry') . "\n";
$data .= 'Comments: ' . $request->input('comments') . "\n";
$data .= 'Created At ' . Carbon::now() . "\n";
Mail::to('service.cri@coreality-inc.com')->send(
new CustomerServiceMail($data)
);
}
catch (Exception $ex)
{
}
return redirect()->back()->with('success', 'We have received your customer sercvice inquiry');
}
}