Controller:-
$exp = explode('/', Input::get('card_expiry'));
if( ($exp[0] <= 12) && $exp[0] > 0 && ( is_int($exp[1]) ) )
{
}
else
{
return back()->withErrors('Add a valid card expiry date');
}
Form:-
<div class="form-group">
<label>Expiry</label>
@if($errors->first('card_expiry'))
<div class="text-danger"></div>
@endif
I am using stripe for payment processing , i want to validate card date whether it is expired or not date format should be 1-12months/upcoming years examples are : 11/19, 12/18, 08/21, 01/20,
For this purpose i tried the above code but its not working please help me out
via Asif Nawaz