<?php

namespace App\Http\Controllers;

use App\Models\Contact;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;

class ContactController extends Controller
{
    public function index()
    {
        $contact = Cache::remember('contact_page_data', 60 * 24, function () {
            return Contact::where('is_active', true)->latest()->first();
        });

        return view('contact.index', compact('contact'));
    }
}