62 lines
1.1 KiB
PHP
62 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Vehicle extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'vehicle';
|
|
|
|
protected $fillable = [
|
|
'placa',
|
|
'niv',
|
|
'marca',
|
|
'linea',
|
|
'sublinea',
|
|
'modelo',
|
|
'color',
|
|
'numero_motor',
|
|
'clase_veh',
|
|
'tipo_servicio',
|
|
'rfv',
|
|
'ofcexpedicion',
|
|
'fechaexpedicion',
|
|
'tipo_veh',
|
|
'numptas',
|
|
'observac',
|
|
'cve_vehi',
|
|
'nrpv',
|
|
'tipo_mov',
|
|
'owner_id',
|
|
'reporte_robo',
|
|
];
|
|
|
|
protected $casts = [
|
|
'reporte_robo' => 'boolean',
|
|
];
|
|
|
|
public function owner()
|
|
{
|
|
return $this->belongsTo(Owner::class);
|
|
}
|
|
|
|
public function records()
|
|
{
|
|
return $this->hasMany(Record::class);
|
|
}
|
|
|
|
public function tag()
|
|
{
|
|
return $this->hasOne(Tag::class);
|
|
}
|
|
|
|
public function vehicleTagLogs()
|
|
{
|
|
return $this->hasMany(VehicleTagLog::class);
|
|
}
|
|
}
|