ActionEvent model sets the default _createdat and _updatedat attributes to new DateTime object in forSoftDeleteAction() (L251), forResourceDetach() (L286) and defaultAttributes() (L357). ActionEvent then uses static::insert() in createForModels() (L317) to persist new models. static::insert(), however, foregoes attribute casting, and escape() called from substituteBindingsIntoRawSql() of \Illuminate\Database\Query\Grammars\Grammar fails with the stack trace below.
This appears to be a new behaviour in my project, and possibly caused by recent Laravel package updates.
As a temporary workaround, I override the ActionEvent model class implementation via ActionResource specified in config/nova.php where I explicitly cast those dates, e.g.:
Please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)
Description:
ActionEvent model sets the default _createdat and _updatedat attributes to new DateTime object in forSoftDeleteAction() (L251), forResourceDetach() (L286) and defaultAttributes() (L357). ActionEvent then uses static::insert() in createForModels() (L317) to persist new models. static::insert(), however, foregoes attribute casting, and escape() called from substituteBindingsIntoRawSql() of \Illuminate\Database\Query\Grammars\Grammar fails with the stack trace below.
This appears to be a new behaviour in my project, and possibly caused by recent Laravel package updates.
As a temporary workaround, I override the ActionEvent model class implementation via ActionResource specified in config/nova.php where I explicitly cast those dates, e.g.:
If any of this appears misguided, I would appreciate any hints as to where to look to fix this casting issue; I may be missing something obvious.
Detailed steps to reproduce the issue on a fresh Nova installation:
Add any action to a resource in Nova (ensuring $withoutActionEvents is set to false). Invoke the action from the UI and watch it fail.