Exemplo n.º 1
0
 /**
  * API function for register device.
  *
  * @return Response
  */
 public function postRegisterDevice()
 {
     $data = post();
     // Validator for post params
     $valids = Validator::make($data, ['device_id' => 'required']);
     // Check is valid
     if ($valids->fails()) {
         return EXRHelper::getErrorMsg($valids->messages());
     }
     $result = Devices::addDevice($data['device_id']);
     return EXRHelper::getSuccess($result);
 }