diff --git a/CHANGELOG.md b/CHANGELOG.md index 601908d..baabc70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All Notable changes to `sebastiaanluca/laravel-boolean-dates` will be documented Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## 6.0.1 (2022-03-17) + +### Fixed + +- Fixed attribute getter value type hint + ## 6.0.0 (2022-03-13) ⚠️ This release is a complete rewrite and changes the way it has to be used. Please consult the [README](README.md) for instructions. diff --git a/src/BooleanDateAttribute.php b/src/BooleanDateAttribute.php index 3ad1847..b25238b 100644 --- a/src/BooleanDateAttribute.php +++ b/src/BooleanDateAttribute.php @@ -12,12 +12,12 @@ class BooleanDateAttribute extends Attribute public static function for(string $column): static { return parent::make( - get: static fn (?string $value, array $attributes): bool => static::getBooleanDate($value, $attributes, $column), + get: static fn (mixed $value, array $attributes): bool => static::getBooleanDate($attributes, $column), set: static fn (mixed $value, array $attributes): array => static::setBooleanDate($value, $attributes, $column), ); } - private static function getBooleanDate(mixed $value, array $attributes, string $column): bool + private static function getBooleanDate(array $attributes, string $column): bool { return array_key_exists($column, $attributes) && $attributes[$column] !== null; }