/** * список услуг в заказе * * @param $id * * @return \Illuminate\View\View */ public function order($id) { try { $api = new Api(); $services = $api->Services($id)['services']; $showButton = true; if (PaymentCloud::checkPaid($id)) { $showButton = false; } $total = 0; foreach ($services as $service) { $total += $service['amount']; } // если не русский, будем переводить if (App::getLocale() != 'ru') { foreach ($services as &$item) { $title = ServiceTitle::whereName($item['name'])->first(); if ($title) { $item['name'] = $title->lang(App::getLocale()); } } } } catch (ApiException $e) { return $this->responseException($e, true); } return View::make('ac::order', ['services' => $services, 'id' => $id, 'showButton' => $showButton, 'total' => $total]); }