Package Version
v2.0.0
Laravel Version
v11.45.3
PHP Version
PHP 8.3.24
Problem description
When you have a boolean attribute value which has changed, the system incorrectly converts it into a date in the display.
> Spatie\Activitylog\Models\Activity::find(7482)->changes();
= Illuminate\Support\Collection {#7914
all: [
"attributes" => [
"user_id" => 58,
"user.email" => "test@example.com",
"customer_id" => 71,
"customer.name" => "Test",
"access_all_sites" => false,
],
],
}
This is caused by the type coercion in https://github.com/rmsramos/activitylog/blob/main/src/Actions/Concerns/ActionContent.php#L340
If a boolean is passed into here it gets converted into one of the other acceptable types. In the case of a FALSE value it seems to be converted to a string, which is subsequently interpreted as a date.
PR incoming.
Expected behavior
Booleans should render true/false correctly.
Steps to reproduce
- Store activity log against a model with a boolean property.
- Set the property to FALSE.
- Look at the activity log view in Filament.
Reproduction repository (issue will be closed if this is not valid)
https://github.com/rmsramos/activitylog
Relevant log output
Package Version
v2.0.0
Laravel Version
v11.45.3
PHP Version
PHP 8.3.24
Problem description
When you have a boolean attribute value which has changed, the system incorrectly converts it into a date in the display.
This is caused by the type coercion in https://github.com/rmsramos/activitylog/blob/main/src/Actions/Concerns/ActionContent.php#L340
If a boolean is passed into here it gets converted into one of the other acceptable types. In the case of a FALSE value it seems to be converted to a string, which is subsequently interpreted as a date.
PR incoming.
Expected behavior
Booleans should render true/false correctly.
Steps to reproduce
Reproduction repository (issue will be closed if this is not valid)
https://github.com/rmsramos/activitylog
Relevant log output