public function excursionGetTotal() { $total_rate = 0; $price_details = array(); $price_box_transport_id = Input::get('price_box_transport_id'); $price_box_ex_id = Input::get('price_box_ex_id'); $price_box_city_id = Input::get('price_box_city_id'); $pax = Input::get('price_box_pax'); $city = City::where('id', $price_box_city_id)->where('val', 1)->first()->city; $transport_type = ExcursionTransportType::where('id', $price_box_transport_id)->first()->transport_type; $get_excursion_price = ExcursionRate::where('excursion_id', '=', $price_box_ex_id)->where('excursion_transport_type_id', '=', $price_box_transport_id)->where('city_id', '=', $price_box_city_id)->where('val', 1)->select('rate')->first(); $get_ex_rate = $get_excursion_price->rate; $ex_rate = Session::get('currency') . ' ' . number_format($get_ex_rate * Session::get('currency_rate'), 2, '.', ''); $get_total_rate = $get_ex_rate * $pax; $total_rate = Session::get('currency') . ' ' . number_format($get_total_rate * Session::get('currency_rate'), 2, '.', ''); $price_details = array('city' => $city, 'transport_type' => $transport_type, 'pax' => $pax, 'ex_rate' => $ex_rate, 'total_rate' => $total_rate); return Response::json($price_details); }