<?php

namespace App\Models;

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

class UserGiftSpin extends Model
{
    protected $fillable = ['user_id', 'prize_id', 'spun_at'];

    protected $casts = [
        'spun_at' => 'datetime',
    ];

    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function prize(): BelongsTo
    {
        return $this->belongsTo(GiftPrize::class, 'prize_id');
    }
}
