ErenErgul
[
$reservationsON,
$companyOdemePrice,
$guidesOdemePrice
] = DB::transaction(function() use($request, $user_guide_accounts, $barcodeDatabase) {
$reservationsON = Tour_reservations::create(...);
$companyOdemePrice = Companies_payments::create(...);
$guidesOdemePrice = Guides_payments::create(...);
return [
$reservationsON,
$companyOdemePrice,
$guidesOdemePrice
];
});
return JsonResource::make([
'reservation' = TourReservationResource::make($reservationsON),
'company_payment' = CompanyPaymentResource::make($companyOdemePrice),
'guide_payment' = GuidePaymentResource::make($guidesOdemePrice),
]);