You should concatenate your fields to one string first. I don't know what format you use, but here's the idea:
$birthdate = sprintf('%s-%s-%s', Input::get('year'), Input::get('month'), Input::get('day'));
Then you pass it to your validator and use regular date
rule like this:
$validator = Validator::make(
array(
// some fields
'birthdate' => $birthdate
),
array(
// some rules
'birthdate' => 'required|date'
)
);
You need to take care of the date to be valid strtotime
string. I assumed somebody's forced to type two digits for day and month and four digits for year.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community