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

[8.x] Fix php 8.1 deprecation in ValidatesAttributes::checkDateTimeOrder #39937

Merged
merged 2 commits into from
Dec 9, 2021
Merged

[8.x] Fix php 8.1 deprecation in ValidatesAttributes::checkDateTimeOrder #39937

merged 2 commits into from
Dec 9, 2021

Conversation

bastien-phi
Copy link
Contributor

Calling DateTime::createFromFormat($format, null) is deprecated with PHP 8.1

Validating

Validator::make(
    ['start' => '31/12/2012', 'ends' => null],
    ['start' => 'date_format:d/m/Y|before:ends', 'ends' => 'date_format:d/m/Y|after:start']
)

triggers this deprecation in ValidatesAttributes::getDateTimeWithOptionalFormat.

@taylorotwell taylorotwell merged commit d1ef8e5 into laravel:8.x Dec 9, 2021
@bastien-phi
Copy link
Contributor Author

Thanks !

@bastien-phi bastien-phi deleted the fix_deprecation_DateTime_createFromFormat_with_null branch December 9, 2021 13:12
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

Successfully merging this pull request may close these issues.

2 participants