Fix SimBrief Controller | flight relationships (#1350)

* Update SimBriefController.php

Fix the fares relationship which was causing trouble when a flight had assigned fares

* Fix model name used in relationship

`Simbrief` should be `SimBrief`
This commit is contained in:
B.Fatih KOZ 2021-11-17 00:26:43 +03:00 committed by GitHub
parent b9c29fbe08
commit 4ea8357952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class SimBriefController
$aircraft_id = $request->input('aircraft_id');
/** @var Flight $flight */
$flight = $this->flightRepo->with(['airline', 'arr_airport', 'dpt_airport', 'fares.fare', 'subfleets'])->find($flight_id);
$flight = $this->flightRepo->with(['airline', 'arr_airport', 'dpt_airport', 'fares', 'subfleets'])->find($flight_id);
if (!$flight) {
flash()->error('Unknown flight');

View File

@ -134,7 +134,7 @@ class Aircraft extends Model
public function simbriefs()
{
return $this->hasMany(Simbrief::class, 'aircraft_id');
return $this->hasMany(SimBrief::class, 'aircraft_id');
}
public function subfleet()