<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property int $file_id
 * @property string $core
 * @property bool $threads
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\EntryFile $file
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting whereCore($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting whereFileId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting whereThreads($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|PlayOnlineSetting whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class PlayOnlineSetting extends Model
{
    protected $primaryKey = 'file_id';
    public $incrementing = false;
    protected $keyType = 'int';

    protected $fillable = [
        'file_id',
        'core',
        'threads'
    ];

    protected $casts = [
        'threads' => 'boolean',
    ];

    public function file(): BelongsTo
    {
        return $this->belongsTo(EntryFile::class, 'file_id');
    }
}
