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
|
|
|
|
2018-03-08 22:51:36 +08:00
|
|
|
use App\Models\Traits\HashIdTrait;
|
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
|
|
|
{
|
2018-03-08 22:51:36 +08:00
|
|
|
use HashIdTrait;
|
2017-12-26 05:19:34 +08:00
|
|
|
|
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',
|
2018-01-02 03:48:02 +08:00
|
|
|
'nav_type',
|
2018-01-02 23:40:42 +08:00
|
|
|
'order',
|
2018-01-02 03:48:02 +08:00
|
|
|
'name',
|
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',
|
2018-01-02 23:40:42 +08:00
|
|
|
'order' => 'integer',
|
2018-01-02 03:48:02 +08:00
|
|
|
'nav_type' => 'integer',
|
2017-12-26 08:22:46 +08:00
|
|
|
'lat' => 'float',
|
|
|
|
'lon' => 'float',
|
|
|
|
'heading' => 'integer',
|
2018-01-29 01:12:13 +08:00
|
|
|
'altitude' => 'float',
|
2017-12-26 08:22:46 +08:00
|
|
|
'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()
|
|
|
|
{
|
2018-01-08 23:22:12 +08:00
|
|
|
return $this->belongsTo(Pirep::class, 'pirep_id');
|
2017-12-26 05:19:34 +08:00
|
|
|
}
|
2017-12-20 10:19:36 +08:00
|
|
|
}
|