'required|email:rfc,dns,spoof|max:255', 'username' => 'required|string|max:255|unique:customers,username', 'firstname' => 'required|string|max:255', 'lastname' => 'required|string|max:255', 'day' => 'required|alpha_num|gt:0|lt:32', 'month' => 'required|alpha_num|gt:0|lt:13', 'year' => [ 'required', 'alpha_num', 'gt:' . (date('Y') - 101), 'lt:' . (date('Y') + 1), function ($attribute, $value, $fail) { $birthDate = Carbon::createFromDate($this->year, $this->month, $this->day); // @phpcs:ignore PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace if ( $birthDate->format('dmY') !== $this->day . $this->month . $this->year || $birthDate > Carbon::now() ) { $fail(__('Veuillez entrer une date de naissance valide')); } } ], 'address' => 'sometimes|max:255', 'phone' => 'sometimes|max:255', 'city' => 'required|string|max:255', 'postcode' => 'required', 'password' => 'required|confirmed|min:8|max:255', 'password' => 'required|confirmed|min:8|max:255', 'optin' => 'sometimes', ]; } }