phpvms/app/Models/Acars.php

60 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace App\Models;
use App\Models\Traits\HashId;
class Acars extends BaseModel
{
use HashId;
public $table = 'acars';
2018-01-01 04:20:52 +08:00
public $incrementing = false;
public $fillable = [
'pirep_id',
'type',
'nav_type',
'order',
'name',
2017-12-26 08:22:46 +08:00
'log',
'lat',
'lon',
2017-12-26 08:22:46 +08:00
'heading',
'altitude',
'vs',
'gs',
'transponder',
'autopilot',
'fuel_flow',
'sim_time',
];
2017-12-26 08:10:24 +08:00
public $casts = [
'type' => 'integer',
'order' => 'integer',
'nav_type' => 'integer',
2017-12-26 08:22:46 +08:00
'lat' => 'float',
'lon' => 'float',
'heading' => 'integer',
'altitude' => 'integer',
'vs' => 'float',
'gs' => 'float',
'transponder' => 'integer',
'fuel_flow' => 'float',
2017-12-26 08:10:24 +08:00
];
2018-01-01 04:20:52 +08:00
public static $rules = [
'pirep_id' => 'required',
];
/**
* FKs
*/
public function pirep()
{
2018-01-08 23:22:12 +08:00
return $this->belongsTo(Pirep::class, 'pirep_id');
}
}