Fix Fare not properly set in controller (#1291)
* Update FareService.php * Update PirepController.php Move the logic to controller as requested * Update FareService.php Reverting back the service changes as requested * StyleFix
This commit is contained in:
parent
b0f52ed1d0
commit
57277c558d
@ -9,6 +9,7 @@ use App\Models\Enums\PirepSource;
|
|||||||
use App\Models\Enums\PirepState;
|
use App\Models\Enums\PirepState;
|
||||||
use App\Models\Pirep;
|
use App\Models\Pirep;
|
||||||
use App\Models\PirepComment;
|
use App\Models\PirepComment;
|
||||||
|
use App\Models\PirepFare;
|
||||||
use App\Repositories\AircraftRepository;
|
use App\Repositories\AircraftRepository;
|
||||||
use App\Repositories\AirlineRepository;
|
use App\Repositories\AirlineRepository;
|
||||||
use App\Repositories\AirportRepository;
|
use App\Repositories\AirportRepository;
|
||||||
@ -151,10 +152,10 @@ class PirepController extends Controller
|
|||||||
$count = $request->input($field_name);
|
$count = $request->input($field_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fares[] = [
|
$fares[] = new PirepFare([
|
||||||
'fare_id' => $fare->id,
|
'fare_id' => $fare->id,
|
||||||
'count' => $count,
|
'count' => $count,
|
||||||
];
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fareSvc->saveForPirep($pirep, $fares);
|
$this->fareSvc->saveForPirep($pirep, $fares);
|
||||||
|
Loading…
Reference in New Issue
Block a user