Skip to content

Commit

Permalink
New config setting datesProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalom committed May 2, 2022
1 parent c319034 commit 28a4b20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ We do not give estimated times for completion on `Accepted` Proposals.

---

## [v9.0.1] - 2022-04-02

`Added`

- New config setting `datesProperty`, set to false by default, to remove the deprecated `dates` property.

## [v9.0.0] - 2022-04-02

`Added`
Expand Down Expand Up @@ -267,7 +273,8 @@ It can work with `nightly`, but is not compatible with `hhvm`, as it uses differ
[Accepted]: https://github.com/Triun/laravel-model-base/labels/Accepted
[Rejected]: https://github.com/Triun/laravel-model-base/labels/Rejected

[Unreleased]: https://github.com/Triun/laravel-model-base/compare/v9.0.0...HEAD
[Unreleased]: https://github.com/Triun/laravel-model-base/compare/v9.0.1...HEAD
[v9.0.1]: https://github.com/Triun/laravel-model-base/compare/v9.0.0...v9.0.1
[v9.0.0]: https://github.com/Triun/laravel-model-base/compare/v6.0.14...v9.0.0
[v6.0.14]: https://github.com/Triun/laravel-model-base/compare/v6.0.13...v6.0.14
[v6.0.13]: https://github.com/Triun/laravel-model-base/compare/v6.0.12...v6.0.13
Expand Down
1 change: 1 addition & 0 deletions config/model-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@

'snakeAttributes' => true,
'dates' => true,
'datesProperty' => false, // deprecated, uses the "casts" property
'dateFormat' => null,
'softDeletes' => true,
// See DELETED_AT configuration.
Expand Down
3 changes: 2 additions & 1 deletion src/Modifiers/DatesModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public function apply(Skeleton $skeleton): void
$this->setProperty($skeleton, 'dateFormat', $this->config('dateFormat'));

// Check if dates is enabled in the config file
if ($this->config('dates', true) !== true) {
// Notice that this property has been deprecated in Laravel 9.x
if (true !== $this->config('datesProperty', false)) {
return;
}

Expand Down

0 comments on commit 28a4b20

Please sign in to comment.