<?php

     namespace App\Http\Controllers;

     use Illuminate\Http\Request;

     class ContactController extends Controller
     {
         public function submit(Request $request)
         {
             $request->validate([
                 'name' => 'required|string|max:255',
                 'email' => 'required|email',
                 'phone' => 'required|string',
                 'message' => 'required|string',
             ]);

             // Logika untuk menyimpan atau mengirim data kontak (misalnya ke email atau database)
             // Contoh: Mail::to('admin@pupukstore.com')->send(new ContactMail($request->all()));

             return redirect()->back()->with('success', 'Pesan Anda telah dikirim!');
         }
     }
