<?php

namespace App\Http\Controllers;

use App\Models\Gallery;
use Illuminate\Http\Request;

class GalleryController extends Controller
{
    public function index()
    {
        $images = Gallery::latest()->paginate(12);
        $categories = Gallery::select('category')->distinct()->pluck('category');
        
        return view('gallery', compact('images', 'categories'));
    }
}

