#32 assign aircraft to subfleets, and aircraft to subfleets
This commit is contained in:
@@ -18,7 +18,7 @@ class Aircraft extends Model
|
||||
|
||||
public $fillable
|
||||
= [
|
||||
'aircraft_class_id',
|
||||
'subfleet_id',
|
||||
'icao',
|
||||
'name',
|
||||
'registration',
|
||||
|
||||
@@ -81,8 +81,8 @@ class Flight extends Model
|
||||
return $this->belongsTo('App\Models\Airport', 'alt_airport_id');
|
||||
}
|
||||
|
||||
public function aircraft()
|
||||
public function subfleets()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\Aircraft', 'flight_aircraft');
|
||||
return $this->belongsToMany('App\Models\Subfleet', 'subfleet_flight');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@ class Subfleet extends Model
|
||||
return $this->belongsTo('App\Models\Airline', 'airline_id');
|
||||
}
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\Flight', 'subfleet_flight');
|
||||
}
|
||||
|
||||
public function ranks()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
|
||||
Reference in New Issue
Block a user