<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Laravel\Sanctum\HasApiTokens;

/**
 * A registered game server allowed to call the REST API (routes/api.php).
 * Each row gets its own Sanctum token, issued from the admin panel, so a
 * token can be revoked per-server without affecting any other server or
 * any dashboard user session.
 */
class FiveMServer extends Model
{
    use HasApiTokens;

    protected $fillable = [
        'name',
        'is_active',
    ];

    protected function casts(): array
    {
        return [
            'is_active' => 'boolean',
        ];
    }
}
