<?php

namespace App\Models;

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

class Betting extends Model
{
    use HasFactory;
    protected $table = 'betting';
    protected $fillable = [
        'user_id',
        'game_id',
        'type',
        'code',
        'color',
        'value',
        'amount',
        'tab',
        'status',
        'result',
        'winning_amount',
        'total_amount'
    ];

    public function gameId()
    {
        return $this->hasOne(GameId::class, 'game_id', 'game_id');
    }

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }
}
