static function getParameters()
 {
     Request::setMethod('GET');
     $gulliverId = Request::get('GID', "");
     $baseId = Request::get('BID', "");
     if ("" == $gulliverId) {
         return false;
     }
     if ("" == $baseId) {
         return false;
     }
     //
     $row = InsuranceModel::where('session', $gulliverId)->where('id', $baseId)->first()->toArray();
     self::$search = json_decode($row['search'], true);
     self::$item = json_decode($row['item'], true);
     unset($row);
     return;
 }
 /**
  * @return mixed
  **/
 public function grid()
 {
     $EncryptedSearch = Request::get('search', "");
     if ("" == $EncryptedSearch) {
         return Response::json(['error' => true, 'description' => 'No search'], 412);
     }
     //
     try {
         $search = Crypt::decrypt($EncryptedSearch);
     } catch (\Exception $e) {
         return Response::json(['error' => true, 'description' => 'Search decode'], 412);
     }
     //
     $response = Gulliver::getInsuranceAvailability(['origin' => mb_convert_case($search['origin'], MB_CASE_UPPER), 'destination' => mb_convert_case($search['destination'], MB_CASE_TITLE), 'dateFrom' => $search['dateFrom'], 'dateTo' => $search['dateTo'], 'passengers' => true == is_array($search['passengers']) ? implode(',', $search['passengers']) : $search['passengers'], 'currency' => 'ARS']);
     if (false == $response) {
         return Response::json(['error' => true, 'description' => Gulliver::$error], 412);
     }
     //
     $sessionId = $response['sessionId'];
     $response = $response['availablePlans'];
     //
     foreach ($response as $key => $item) {
         $response[$key]['insuranceTotalPrices']['requestedSellingPrice']['taxes'] = $item['insuranceTotalPrices']['requestedSellingPrice']['afterTax'] - $item['insuranceTotalPrices']['requestedSellingPrice']['beforeTax'];
         //
         $row = InsuranceModel::store(['session' => $sessionId, 'plan_number' => $key, 'item' => json_encode($response[$key]), 'search' => json_encode($search)]);
         //  http://viajes-laravel.dev/compra/seguros/?GID=71ff1103-d3c6-4e12-92b1-0caccc864d2a&BID=1
         $response[$key]['booking'] = url() . '/compra/seguros?' . http_build_query(['GID' => $sessionId, 'BID' => $row->id]);
     }
     //
     Cookie::queue(self::$config['cookieName'], $search, self::$config['cookieTtl']);
     //
     return Response::json(['error' => false, 'description' => 'Ok', 'total' => sizeof($response), 'grid' => view('Insurance/grid')->with(['destination' => mb_convert_case($search['destination'], MB_CASE_LOWER), 'response' => $response])->render()], 200);
 }