#21 base code for accepting/rejecting PIREPs

This commit is contained in:
Nabeel Shahzad
2017-07-04 01:05:37 -05:00
parent c310bffed9
commit 77b164a64c
14 changed files with 285 additions and 58 deletions

View File

@@ -29,6 +29,7 @@ class Pirep extends Model
'route_leg',
'dpt_airport_id',
'arr_airport_id',
'source',
'level',
'route',
'notes',
@@ -43,14 +44,10 @@ class Pirep extends Model
*/
protected $casts
= [
'user_id' => 'integer',
'flight_id' => 'string',
'aircraft_id' => 'integer',
'flight_time' => 'integer',
'level' => 'integer',
'route' => 'string',
'notes' => 'string',
'raw_data' => 'string',
'source' => 'integer',
'status' => 'integer',
];
/**
@@ -92,6 +89,11 @@ class Pirep extends Model
return $this->belongsTo('App\Models\Flight', 'flight_id');
}
public function pilot()
{
return $this->user();
}
public function user()
{
return $this->belongsTo('App\Models\User', 'user_id');