-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I’m using Laravel Auditing with a TINYINT(1) (non-null) column for a boolean field (e.g. hasTubes
). In my Eloquent model, I’ve cast this column to a boolean ('hasTubes' => 'boolean'
). When I toggle the field in my Filament form between true
(1) and false
(0), the audit entries sometimes display the old/new values as 1
or 0
, but other times they appear blank (see the screenshot below).
Screenshot
Steps to Reproduce:
- Use Laravel Auditing on a model with a TINYINT(1) column for a boolean field (e.g.
hasTubes
), not nullable, default0
. - Cast it to
'boolean'
in the model’s$casts
array. - In a Filament form, toggle the field from
false
totrue
(or vice versa). - View the audit log – notice that
old_values
ornew_values
sometimes show1
/0
and sometimes display a blank value.
Expected Behavior:
- The
old_values
andnew_values
should always show0
or1
(ortrue
/false
) consistently in the audit log, rather than occasionally appearing blank.
Actual Behavior:
- Occasionally, the audit log for boolean fields appears blank for one of the values, even though the DB is storing
0
or1
and the model has a correct boolean cast.
Additional Context:
- Model casting array:
protected $casts = [ 'hasTubes' => 'boolean', // ... ];
Metadata
Metadata
Assignees
Labels
No labels