Output PIREP map with just the dep/arr airports for now

This commit is contained in:
Nabeel Shahzad
2017-12-20 11:28:21 -06:00
parent eac3b256b3
commit e5278bc0bf
10 changed files with 812 additions and 69 deletions

View File

@@ -30,6 +30,7 @@ class Airport extends Model
protected $casts = [
'id' => 'string',
];
/**
* Validation rules
*
@@ -42,7 +43,8 @@ class Airport extends Model
/**
* Some fancy callbacks
*/
protected static function boot() {
protected static function boot()
{
parent::boot();
@@ -54,4 +56,14 @@ class Airport extends Model
$model->id = $model->icao;
});
}
/**
* Return full name like:
* KJFK - John F Kennedy
* @return string
*/
public function getFullNameAttribute(): string
{
return $this->icao . ' - ' . $this->name;
}
}

View File

@@ -131,6 +131,11 @@ class Pirep extends Model
return $this->user();
}
public function route()
{
return [];
}
public function user()
{
return $this->belongsTo('App\Models\User', 'user_id');