<?php

namespace App\FiveM\Models\QBCore;

use Illuminate\Database\Eloquent\Model;

/**
 * Maps to the qb-houses convention: id, citizenid, house, garage,
 * decorations (json). Server owners on a different housing resource
 * (e.g. qb-apartments) can override `fivem.tables.qbcore.houses` and adjust
 * the column list in this model without touching any controller.
 */
class House extends Model
{
    protected $connection = 'fivem';

    public $timestamps = false;

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

    public function getTable()
    {
        return config('fivem.tables.'.config('fivem.framework').'.houses', 'player_houses');
    }
}
