<?php

namespace App\Http\Controllers\Web\Favorites;

use App\Http\Controllers\Controller;

class FavoritesPageController extends Controller
{
    public function index()
    {
        $favs = auth()->user()->favorites()->with(['product' => ['media', 'brand']])->get();
        $products = $favs->map(fn ($fav) => $fav->product);

        return view('web.themes.shella.pages.favorites.index', [
            'products' => $products,
            'user_likes' => $products,
        ]);
    }
}
