Skip to content

Model::preventSilentlyDiscardingAttributes throws error for missing [created_at, updated_at] in fillable #572

@itsrafsanjani

Description

@itsrafsanjani

Describe the bug
Laravel 9.28 added Eloquent mode to prevent silently discarding fills for attributes not in $fillable (#43893)

To Reproduce

  1. Go to AppServiceProvider's boot method
  2. Add
Model::preventSilentlyDiscardingAttributes(! app()->isProduction());
  1. Try to deposit

Trace Error
{"type":"error","message":"Transaction failed. Message: Add fillable property [created_at, updated_at] to allow mass assignment on [Bavix\\Wallet\\Models\\Transaction]."}

Expected behavior
created_at and updated_at should not throw error like this

Server:

  • php version: 8.1
  • database: mysql 5.7
  • wallet version 9.3
  • cache lock: file
  • cache wallets: file

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions