In your controller set this code after form post :-
$rules = array(
'categoryname' => 'required|alpha',
'childrenacceptjesus' => 'required|numeric',
'file' => 'required|max:10000',
'childrengraduated' => 'required|numeric|max:450',
'email' => 'required|email|unique:users',
'username' => 'required|min:6|unique:users',
'password' => 'required|confirmed|min:6'
'pda' => 'required|unique:forms',
'password' => 'required|min:8|confirmed',
'password_confirmation' => 'required|min:8',
);
$data = Input::all();
$validation = Validator::make ($data, $rules);
if ($validation->passes())
{
//true
} else
{
//false
}
$rules = array(
'categoryname' => 'required|alpha',
'childrenacceptjesus' => 'required|numeric',
'file' => 'required|max:10000',
'childrengraduated' => 'required|numeric|max:450',
'email' => 'required|email|unique:users',
'username' => 'required|min:6|unique:users',
'password' => 'required|confirmed|min:6'
'pda' => 'required|unique:forms',
'password' => 'required|min:8|confirmed',
'password_confirmation' => 'required|min:8',
);
$data = Input::all();
$validation = Validator::make ($data, $rules);
if ($validation->passes())
{
//true
} else
{
//false
}
No comments:
Post a Comment