'integer', 'order' => 'integer', 'nav_type' => 'integer', 'lat' => 'float', 'lon' => 'float', 'distance' => 'integer', 'heading' => 'integer', 'altitude' => 'float', 'vs' => 'float', 'gs' => 'float', 'transponder' => 'integer', 'fuel' => 'float', 'fuel_flow' => 'float', ]; public static $rules = [ 'pirep_id' => 'required', ]; /** * Set the distance unit, convert to our internal default unit * * @param $value */ public function setDistanceAttribute($value): void { if ($value instanceof Distance) { $this->attributes['distance'] = $value->toUnit( config('phpvms.internal_units.distance') ); } else { $this->attributes['distance'] = $value; } } /** * Set the amount of fuel * * @param $value */ public function setFuelAttribute($value) { if ($value instanceof Fuel) { $this->attributes['fuel'] = $value->toUnit( config('phpvms.internal_units.fuel') ); } else { $this->attributes['fuel'] = $value; } } /** * FKs */ public function pirep() { return $this->belongsTo(Pirep::class, 'pirep_id'); } }