2017-12-20 10:19:36 +08:00
|
|
|
<?php
|
|
|
|
|
2017-12-26 05:19:34 +08:00
|
|
|
namespace App\Models;
|
2017-12-20 10:19:36 +08:00
|
|
|
|
2017-12-26 05:19:34 +08:00
|
|
|
use App\Models\Traits\HashId;
|
2017-12-20 10:19:36 +08:00
|
|
|
|
2017-12-26 05:19:34 +08:00
|
|
|
class Acars extends BaseModel
|
2017-12-20 10:19:36 +08:00
|
|
|
{
|
2017-12-26 05:19:34 +08:00
|
|
|
use HashId;
|
|
|
|
|
2017-12-20 10:19:36 +08:00
|
|
|
public $table = 'acars';
|
2018-01-01 04:20:52 +08:00
|
|
|
public $incrementing = false;
|
2017-12-26 05:19:34 +08:00
|
|
|
|
|
|
|
public $fillable = [
|
|
|
|
'pirep_id',
|
2018-01-02 00:30:31 +08:00
|
|
|
'type',
|
2017-12-26 08:22:46 +08:00
|
|
|
'log',
|
2017-12-26 05:19:34 +08:00
|
|
|
'lat',
|
|
|
|
'lon',
|
2017-12-26 08:22:46 +08:00
|
|
|
'heading',
|
2017-12-26 05:19:34 +08:00
|
|
|
'altitude',
|
|
|
|
'vs',
|
|
|
|
'gs',
|
|
|
|
'transponder',
|
|
|
|
'autopilot',
|
|
|
|
'fuel_flow',
|
|
|
|
'sim_time',
|
|
|
|
];
|
|
|
|
|
2017-12-26 08:10:24 +08:00
|
|
|
public $casts = [
|
2018-01-02 00:30:31 +08:00
|
|
|
'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',
|
|
|
|
];
|
|
|
|
|
2017-12-26 05:19:34 +08:00
|
|
|
/**
|
|
|
|
* FKs
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function pirep()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\Pirep', 'pirep_id');
|
|
|
|
}
|
2017-12-20 10:19:36 +08:00
|
|
|
}
|