phpvms/app/Models/Acars.php

55 lines
1009 B
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',
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',
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()
{
return $this->belongsTo('App\Models\Pirep', 'pirep_id');
}
}