<?php

namespace App\Http\Controllers;

use App\Models\ContentBlock;
use App\Models\GalleryImage;
use App\Models\GallerySection;
use Illuminate\View\View;

class GalleryController extends Controller
{
    public function index(): View
    {
        return view('pages.gallery', [
            'page' => 'gallery',
            'blocks' => ContentBlock::forPage('gallery'),
            'featureImage' => GalleryImage::query()->where('is_featured', true)->first(),
            'sections' => GallerySection::query()->with('images')->orderBy('sort_order')->get(),
        ]);
    }
}
