public function search()
 {
     //check if its our form  (prevents cross site injections)
     // TODO #7
     // if ( Session::token() !== Input::get( '_token' ) ) {
     //     return Response::json( array(
     //         'msg' => 'Unauthorized attempt to create option'
     //     ) );
     // }
     Log::info(Input::all());
     $updates_sno = Input::get('updates-sno');
     $updates_name = Input::get('updates-name');
     $updates_age = Input::get('updates-age');
     Log::info("===[AU Search]===");
     Log::info($updates_sno);
     Log::info($updates_name);
     Log::info($updates_age);
     $results = ArmyUpdates::searchWithParam($updates_sno, $updates_name, $updates_age);
     Log::info("===[AU Search Results]===");
     Log::info(json_encode($results));
     $response = array('status' => 'success', 'results' => json_encode($results));
     return Response::json($response);
 }
Esempio n. 2
0
 public static function searchWithNameAndAge($find_name, $find_age)
 {
     return ArmyUpdates::searchWithParam("", $find_name, $find_age);
 }