phpvms/app/Models/Acars.php

66 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace App\Models;
use App\Interfaces\Model;
use App\Models\Traits\HashIdTrait;
/**
* Class Acars
* @param string id
* @package App\Models
*/
class Acars extends Model
{
use HashIdTrait;
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',
'lat' => 'float',
'lon' => 'float',
'heading' => 'integer',
'altitude' => 'float',
'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',
2018-01-01 04:20:52 +08:00
];
/**
* FKs
*/
public function pirep()
{
2018-01-08 23:22:12 +08:00
return $this->belongsTo(Pirep::class, 'pirep_id');
}
}