Level 70
1st : I want something like that employee age must be 18 or greater than 18 years
You can do it easily by:
'dob' => [
'required',
'date',
'before_or_equal:' . now()->subYears(18)->format('Y-m-d')
],
2nd : I want to add a mobile number validation for every country and with country code.
You need to depend on the package. For example:
Then you can easily like this:
'mobile' => [
'required',
'phone:AUTO', // AUTO will detect the country from the input or you can specify specific countries like 'phone:US,IN'
],
3 likes