Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carbon::setTestNow ignored during validation #19520

Closed
CSigelmann opened this issue Jun 7, 2017 · 1 comment
Closed

Carbon::setTestNow ignored during validation #19520

CSigelmann opened this issue Jun 7, 2017 · 1 comment

Comments

@CSigelmann
Copy link

  • Laravel Version: 5.4.25
  • PHP Version: 5.6.30

Description:

There are a few places where strtotime() is used in Laravel, for example in getDateTimestamp in ValidatesAttributes.php. This makes it so that Carbon::setTestNow() is ignored for validation.

I feel like this should be changed in a similar manner to #15544

Steps To Reproduce:

Carbon::setTestNow(Carbon::parse('2000-01-01', 'UTC'));
$validator = Validator::make(['date' => '2005-06-06 12:00:00Z'], ['date' => 'after:now']);
dd($validator->errors()->all()); // "The date must be a date after now."
@themsaid
Copy link
Member

themsaid commented Jun 7, 2017

Feel free to open a PR :)

Closing since it's not a bug report but rather a change request, we're open to PRs on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants