<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AdvertisementSplashImpression extends Model
{
    protected $fillable = [
        'advertisement_id',
        'viewer_role',
        'viewer_id',
        'view_date',
        'count',
    ];

    protected $casts = [
        'view_date' => 'date',
    ];

    public function advertisement(): BelongsTo
    {
        return $this->belongsTo(Advertisement::class, 'advertisement_id');
    }
}
