<?php

namespace App\Livewire\User;

use App\Models\Product;
use Livewire\Component;

class RecentTab extends Component
{
    public $products;

    public function render()
    {
        $this->products = Product::whereHas('viewers', function ($query) {
            $query->where('user_id', auth()->id());
        })->get();

        return view('livewire.user.recent-tab');
    }
}
