Example #1
0
 /**
  * Display the specified resource.
  *
  * @param $lang
  * @param  int $code
  * @return \Illuminate\Http\Response
  */
 public function show($lang, $code)
 {
     header('Content-Type: application/json');
     header('Access-Control-Allow-Origin: *');
     $properties['country'] = Input::get('country');
     $properties['flow'] = Input::get('flow');
     $properties['from_date'] = Input::get('from_date');
     $properties['to_date'] = Input::get('to_date');
     $properties['lang'] = $lang;
     $commodity = $this->dao->getCommodity($code, $properties);
     if (empty($commodity)) {
         return response('No data found', Response::HTTP_NO_CONTENT);
     }
     $response = json_encode($commodity, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     return response($response, Response::HTTP_OK);
 }