use laravel to validate the form.
routing: get is the registration view page, post is the registration logic
Route::get("regist","User\RegistController@registView");
Route::post("regist","User\RegistController@regist");
form
<form class="form-signin" method="POST" action="/regist">
.....
</form>
Code for validation
$this->validator=Validator::make($input,$rule,$message);
if($this->validator->fails()){
return \Redirect::back()->withErrors($this->err());
}
the problem now is:
form validation failed and no error message is displayed. You need to click enter in the address bar and reload the page to display the error message. I don"t know why.
Note: my form validation is written in a separate class. I only want to use Validator::make to implement validation without controller methods.