vendredi 18 mai 2018

Laravel date format validation dd/mm/yyyy

A simple thing, please help me out. I want to validate date format(dd/mm/yyyy). If my input is 05/02/1991 or 5/2/1991 it should return 'true' but

 public function rules()
  {
    return [
        'date_of_birth'         => 'required|date_format:"d/m/Y"'
    ];
  }

in the above rule it returns true only for 05/02/1991 . I need to match both of them.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire