<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Casts\AsArrayObject;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class VehicleRecord extends Model
{
    protected $fillable = [
        'registration_number',
        'data',
    ];

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

    public function dataSources(): HasMany
    {
        return $this->hasMany(VehicleDataSource::class);
    }
}
