<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Models\Product;
use App\Models\Category;
use App\Models\HeroImage;

class HomeController extends Controller
{
    public function index()
    {
        $categories = Category::all();
        $featuredWallpapers = Product::where('type', 'wallpaper')->where('featured', true)->take(3)->get();
        $featuredMurals = Product::where('type', 'mural')->where('featured', true)->take(3)->get();
        $heroImages = HeroImage::where('page', 'home')->where('is_active', true)->orderBy('sort_order')->get();
        
        return view('home', [
            'categories' => $categories,
            'featuredWallpapers' => $featuredWallpapers,
            'featuredMurals' => $featuredMurals,
            'heroImages' => $heroImages
        ]);
    }
}
