<?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;

class JackpotBetting extends Model
{
    use Notifiable, SoftDeletes;

    # define table
    protected $table = 'jackpot_bettings';

    # define fillable fields
    protected $fillable = [
        'user_id',
        'period_id',
        'number',
        'balance',
        'result',
        'amount',
        'profit',
        'loss',
        '1',
        '2',
        '3',
        '4',
        '5',
        'status',
    ];

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

    public function period()
    {
        return $this->hasOne(new Period(), 'id', 'period_id');
    }
}
