Add to request in Laravel?

I am using Laravel's built in authentication and adding to birthday. I have several select fields that have month and year. I want to combine them in the RegisterUsers.php postRegister method to make the PHP read the date and pass it to AuthController for validation. I thought

$request['date'] = strtotime($request['month'] . $request['day'] . $request['year']);

      

and then continue the request. Is there a cleaner way to do this? Also, I want to confirm the date. What validation options can you use in the validation function? I wish you could not enter April 31st birthday, because April only has 30 days.

+3


source to share


1 answer


You can use nesbot carbon package for dates and related materials carbon.nesbot.com



0


source







All Articles