Clean up the GeoJSON generation code

This commit is contained in:
Nabeel Shahzad
2018-01-01 16:01:01 -06:00
parent d1c626afe8
commit 5cf0bbaa65
8 changed files with 233 additions and 160 deletions

View File

@@ -94,6 +94,13 @@ class Pirep extends BaseModel
->orderBy('created_at', 'asc');
}
public function acars_route()
{
return $this->hasMany('App\Models\Acars', 'pirep_id')
->where('type', AcarsType::ROUTE)
->orderBy('created_at', 'asc');
}
public function aircraft()
{
return $this->belongsTo('App\Models\Aircraft', 'aircraft_id');