<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class BetItem extends Model
{
    protected $fillable = [
        'bet_id', 'game_id', 'sport_match_id',
        'item_type', 'title', 'selection', 'odds', 'result',
    ];

    protected function casts(): array
    {
        return ['odds' => 'decimal:4'];
    }

    public function bet()
    {
        return $this->belongsTo(Bet::class);
    }

    public function game()
    {
        return $this->belongsTo(Game::class);
    }

    public function sportMatch()
    {
        return $this->belongsTo(SportMatch::class);
    }
}
