Enabling "Strict Mode" on Eloquent Model #797
-
When enabling strict mode: https://laravel.com/docs/9.x/eloquent#configuring-eloquent-strictness
It will print an error:
|
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 1 reply
-
Experiencing the same. Any solution? |
Beta Was this translation helpful? Give feedback.
-
Same problem after trying to enable |
Beta Was this translation helpful? Give feedback.
-
Declare audit properties on User model public $auditEvents = null;
public $auditDriver = null;
public $auditExclude = null;
public $auditInclude = null;
public $auditStrict = null;
public $auditTimestamps = null;
public $attributeModifiers = null; |
Beta Was this translation helpful? Give feedback.
-
Tried this, but same issue. |
Beta Was this translation helpful? Give feedback.
-
I added the following code to my model and it's working fine:
Might make sense to add this into the |
Beta Was this translation helpful? Give feedback.
-
@anteriovieira ? :) |
Beta Was this translation helpful? Give feedback.
-
Any update on this issue? |
Beta Was this translation helpful? Give feedback.
-
@DannyRevenant that would be a breaking change, If someone already has any of these properties, they would get a redeclaration exception. |
Beta Was this translation helpful? Give feedback.
-
As @angeljqv says, we can't declare those properties in the package. |
Beta Was this translation helpful? Give feedback.
Declare audit properties on User model