#32 moved fares to subfleets
This commit is contained in:
@@ -55,14 +55,6 @@ class Aircraft extends Model
|
||||
* foreign keys
|
||||
*/
|
||||
|
||||
public function fares()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
'App\Models\Fare',
|
||||
'aircraft_fare'
|
||||
)->withPivot('price', 'cost', 'capacity');
|
||||
}
|
||||
|
||||
public function subfleet()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Subfleet', 'subfleet_id');
|
||||
|
||||
@@ -55,10 +55,10 @@ class Fare extends Model
|
||||
* any foreign keys
|
||||
*/
|
||||
|
||||
public function aircraft() {
|
||||
public function subfleets() {
|
||||
return $this->belongsToMany(
|
||||
'App\Models\Aircraft',
|
||||
'aircraft_fare'
|
||||
'App\Models\Subfleet',
|
||||
'subfleet_fare'
|
||||
)->withPivot('price', 'cost', 'capacity');
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,14 @@ class Subfleet extends Model
|
||||
return $this->belongsTo('App\Models\Airline', 'airline_id');
|
||||
}
|
||||
|
||||
public function fares()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
'App\Models\Fare',
|
||||
'subfleet_fare'
|
||||
)->withPivot('price', 'cost', 'capacity');
|
||||
}
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\Flight', 'subfleet_flight');
|
||||
|
||||
Reference in New Issue
Block a user