'Updated Drop Date Packing List', 'message' => 'You have successfully updated the Drop Date Packing List' ]; } /** @var UpdatesDropDateTransport */ private $updatesDropDateTransport; /** @var FetchesPackingList */ private $fetchesPackingList; /** * UpdateDispatchDatePackingListLogic constructor. * @param CanUpdateContainer $canUpdateContainer * @param UpdatesDropDateTransport $updatesDropDateTransport * @param FetchesPackingList $fetchesPackingList */ public function __construct(UpdatesDropDateTransport $updatesDropDateTransport, FetchesPackingList $fetchesPackingList) { $this->updatesDropDateTransport = $updatesDropDateTransport; $this->fetchesPackingList = $fetchesPackingList; } /** * @param Request $request * @return JsonResponse * @throws ErrorException */ public function logic(Request $request) : JsonResponse { $packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]); $transport = $packing_list->transports()->first(); $query = $this->updatesDropDateTransport->execute($transport, Carbon::parse($request->input('drop_date'))); return $this->resourceResponse(new PackingListResource($packing_list)); } }