Add pivot table for flight_fare to override fare #125
This commit is contained in:
@@ -82,6 +82,14 @@ class Flight extends BaseModel
|
||||
return $this->belongsTo('App\Models\Airport', 'alt_airport_id');
|
||||
}
|
||||
|
||||
public function fares()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Fare::class,
|
||||
'flight_fare'
|
||||
)->withPivot('price', 'cost', 'capacity');
|
||||
}
|
||||
|
||||
public function fields()
|
||||
{
|
||||
return $this->hasMany('App\Models\FlightFields', 'flight_id');
|
||||
|
||||
Reference in New Issue
Block a user