<?php

namespace App\FiveM\Models\QBCore;

use Illuminate\Database\Eloquent\Model;

/**
 * Maps to QBCore's/qb-core `player_vehicles` table (the qb-garages/
 * qbx_vehicles convention: id, citizenid, vehicle, hash, mods json, plate,
 * garage, state).
 */
class Vehicle extends Model
{
    protected $connection = 'fivem';

    public $timestamps = false;

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

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