reclamations()->create([ 'reclamation_type_id' => ReclamationType::idForCode(ReclamationType::CODE_OTHER), 'user_id' => $productionOrder->manager_id, 'status_id' => Reclamation::STATUS_NEW, 'create_date' => Carbon::now(), 'finish_date' => Carbon::now()->addDays(30), ]); $reclamation->productionOrderItems()->attach($request->validated('item_ids')); return $reclamation; }); $reclamation->load(['productionOrder', 'status']); $notificationService->notifyReclamationCreated($reclamation, $request->user()); $notificationService->notifyProductionOrderEvent( $productionOrder, ProductionOrderNotificationEvent::ReclamationAdded, $request->user(), ); return redirect()->route('reclamations.show', $this->withNav( ['reclamation' => $reclamation], $this->resolveNavToken($request), )); } }