cleanup model relationship references

This commit is contained in:
Nabeel Shahzad
2018-01-08 09:22:12 -06:00
parent 8d65462084
commit 110d742714
13 changed files with 56 additions and 54 deletions

View File

@@ -64,39 +64,37 @@ class Flight extends BaseModel
public function airline()
{
return $this->belongsTo('App\Models\Airline', 'airline_id');
return $this->belongsTo(Airline::class, 'airline_id');
}
public function dpt_airport()
{
return $this->belongsTo('App\Models\Airport', 'dpt_airport_id');
return $this->belongsTo(Airport::class, 'dpt_airport_id');
}
public function arr_airport()
{
return $this->belongsTo('App\Models\Airport', 'arr_airport_id');
return $this->belongsTo(Airport::class, 'arr_airport_id');
}
public function alt_airport()
{
return $this->belongsTo('App\Models\Airport', 'alt_airport_id');
return $this->belongsTo(Airport::class, 'alt_airport_id');
}
public function fares()
{
return $this->belongsToMany(
Fare::class,
'flight_fare'
)->withPivot('price', 'cost', 'capacity');
return $this->belongsToMany(Fare::class, 'flight_fare')
->withPivot('price', 'cost', 'capacity');
}
public function fields()
{
return $this->hasMany('App\Models\FlightFields', 'flight_id');
return $this->hasMany(FlightFields::class, 'flight_id');
}
public function subfleets()
{
return $this->belongsToMany('App\Models\Subfleet', 'subfleet_flight');
return $this->belongsToMany(Subfleet::class, 'subfleet_flight');
}
}