<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RouletteDrop extends Model
{
    const UPDATED_AT = null;

    protected $fillable = [
        'user_id',
        'roulette_item_id',
        'value',
        'claimed_at',
    ];

    protected function casts(): array
    {
        return [
            'value' => 'integer',
            'claimed_at' => 'datetime',
        ];
    }

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

    public function item()
    {
        return $this->belongsTo(RouletteItem::class, 'roulette_item_id');
    }
}
