You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✏️ Describe the bug
If I create one property with Carbon type, and other primitive type, dispatch exception.
↪️ To Reproduce
Provide us a pest test like this one which shows the problem:
it('error in Carbon properties with primitive type', function () {
class BaseData extends Data
{
publicfunction__construct(
publicCarbon|int|null$date,
) {
}
}
// Dispatch CannotCastDate Exception: Could not cast date `5` into a `Illuminate\Support\Carbon` using formats: Y-m-d\TH:i:sPdd($data = BaseData::from(['date' => 5]));
expect($data->date)->toBe(5);
});
✅ Expected behavior
Accept the int value too.
🖥️ Versions
Laravel: 11.41.3
Laravel Data: 4.13.1
PHP: 8.4.3
The text was updated successfully, but these errors were encountered:
✏️ Describe the bug
If I create one property with
Carbon
type, and other primitive type, dispatch exception.↪️ To Reproduce
Provide us a pest test like this one which shows the problem:
✅ Expected behavior
Accept the
int
value too.🖥️ Versions
Laravel: 11.41.3
Laravel Data: 4.13.1
PHP: 8.4.3
The text was updated successfully, but these errors were encountered: