<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ProductView extends Model
{
    use HasFactory;

    protected $table = 'product_views';

    protected $fillable = [
        'product_id',
        'ip_address',
        'created_at',
    ];

    public $timestamps = false; // We only use created_at

    public function product()
    {
        return $this->belongsTo(Product::class, 'product_id', 'id');
    }
}
