<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Models\Day;

class ChakriResults extends Model
{
    use Notifiable, SoftDeletes;

    # define table
    protected $table = 'chakri_results';

    # define fillable fields
    protected $fillable = [
        'period_id',
        'game_id',
        'bet_place',
        'admin_amount',
        'total_bet_amount',
        'distributed_amount',
        'status',

    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'status'  => 'boolean',
    ];

    

    public function game()
    {
        return $this->hasOne(new ChakriGames(), 'id', 'game_id');
    }
    
    
    public function period()
    {
        return $this->hasOne(new ChakriPeriods(), 'id', 'period_id');
    }
}
