Absolutely, you’ve diagnosed the problem correctly. Filament (or rather, Eloquent, which Filament relies on) automatically assumes your models have created_at and updated_at columns unless you specifically tell it not to. When Filament tries to create or update an AccountNote, Eloquent tries to insert values for those columns, hence the SQL error because they don’t actually exist in your account_notes table.
Solution:
You just need to tell Eloquent that your AccountNote model does not use timestamps by setting the $timestamps property to false. Add this property to your AccountNote model:
class AccountNote extends Model
{
public $timestamps = false;
// ...your relationships and other code
}
With this, Eloquent (and thus Filament) will stop trying to use created_at and updated_at, and your insert will work.
Summary of steps:
- Open your
AccountNotemodel. - Add:
public $timestamps = false; - Enjoy not needing to add unnecessary timestamp columns to your table!
Reference: Eloquent: Timestamps Documentation