public function postRegistro() { include_once public_path() . '/securimage/securimage.php'; $securimage = new Securimage(); $captcha_sesion = strtoupper($securimage->getCode()); include app_path() . "/include/cifrado.php"; $empresa = new Empresa(); $data = Input::all(); $data['captcha_sesion'] = $captcha_sesion; $data['captcha_code'] = strtoupper($data['captcha_code']); if (!$empresa->isValid($data)) { return Redirect::action('Empresa_EmpresaController@getRegistro')->withInput(Input::except('password'))->withErrors($empresa->errors)->with('id_municipio', $data['municipio']); } foreach ($data as $key => $value) { if ($key != 'password' && $key != 'email') { $data[$key] = strtoupper($value); } } $data['password'] = encriptar($data['password']); $data['cod_verif'] = rand(111111, 999999); $empresa->fill($data); $empresa->save(); return Redirect::action('Empresa_EmpresaController@getVerificar', array($empresa->id))->with('message_ok', 'Registro Completado. Por favor, inserte el código de verificación que le hemos enviado a su correo electrónico. Gracias'); }