<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use \App\Http\Requests\SupportTechnicalRequest;
use Carbon\Carbon;

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(),
        ]);
        return redirect()->back()->with('success', 'We have received your technical inquiry！');
    }
}
