Skip to content

Instantly share code, notes, and snippets.

@Mason8r
Created January 24, 2014 12:11
Show Gist options
  • Save Mason8r/8596210 to your computer and use it in GitHub Desktop.
Save Mason8r/8596210 to your computer and use it in GitHub Desktop.
//I have a simple 'regcode' form that posts to 'direct'
Route::get('direct', function() {
return View::make('direct');
});
Route::post('direct', function() {
$data = Input::all();
$rules = array(
'regcode' => 'min:9|max:9|required|exists:reg_codes,reg_code'
);
$validation = Validator::make( $data , $rules );
if( $validation->fails() ) {
foreach ($messages->all() as $message)
{
echo $message;
}
//return Redirect::to('direct')->withErrors($validation);
}
//return Input::get('regcode');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment