Skip to content

Instantly share code, notes, and snippets.

@shinigamicorei7
Last active August 29, 2015 14:11
Show Gist options
  • Save shinigamicorei7/5c34ff96683e4126ed2d to your computer and use it in GitHub Desktop.
Save shinigamicorei7/5c34ff96683e4126ed2d to your computer and use it in GitHub Desktop.
Validación del formulario de registro
public function create() {
$input = Input::except('_token');
$rules = [
'firstname' => 'required',
'lastname' => 'required',
'email' => 'required|email|unique:usuario,email_usr',
'password' => 'required|min:8|confirmed',
'password_confirmation' => 'required',
];
$v = Validator::make($input, $rules);
if ($v->fails()) {
return Redirect::route('register')->withErrors($v)->withInput(Input::only('firstname', 'lastname', 'email', 'password'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment