<?php

namespace App\Http\Controllers;

use App\Models\AppSetting;
use App\Models\Frame;
use App\Models\Package;
use App\Models\User;
use Illuminate\Http\Request;

class LandingController extends Controller
{
    public function index()
    {
        $packages = Package::where('is_active', true)->orderBy('months')->get();
        $sampleFrames = Frame::where('is_active', true)->with('vendor.vendorProfile')->take(6)->get();
        $totalVendors = User::where('role', 'vendor')->where('status', true)->count();
        $settings = AppSetting::first();

        return view('landing', compact('packages', 'sampleFrames', 'totalVendors', 'settings'));
    }

    public function privacy()
    {
        return view('pages.privacy');
    }

    public function terms()
    {
        return view('pages.terms');
    }

    public function about()
    {
        return view('pages.about');
    }

    public function contact()
    {
        $settings = AppSetting::first();
        return view('pages.contact', compact('settings'));
    }
}
