<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class ContactController extends Controller
{
    /**
     * Submit contact form.
     */
    public function submit(Request $request)
    {
        $validated = $request->validate([
            'name'    => 'required|string|max:255',
            'email'   => 'required|email',
            'phone'   => 'nullable|string|max:50',
            'subject' => 'nullable|string|max:255',
            'message' => 'required|string|max:2000',
        ]);

        // Here you can: send email, save to DB, etc.
        // For now we just redirect with success message.
        return redirect()->back()->with('contact_success', true);
    }

    /**
     * Submit quote request form.
     */
    public function quote(Request $request)
    {
        $validated = $request->validate([
            'name'     => 'required|string|max:255',
            'email'    => 'required|email',
            'phone'    => 'required|string|max:50',
            'company'  => 'nullable|string|max:255',
            'service'  => 'nullable|string|max:255',
            'message'  => 'nullable|string|max:2000',
        ]);

        // Here you can: send email, save to DB, etc.
        return redirect()->back()->with('quote_success', true);
    }
}
