Skip to content

Unknown column 'auditEvents' in 'field list' #922

@cristiansoftlead

Description

@cristiansoftlead
Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 10.48.3
Package version 13.6.5
PHP version 8.2

Actual Behaviour

After installation, I added the traits in one of the models and when I try to update an entry, it returns the error:

Column not found: 1054 Unknown column 'auditEvents' in 'field list'
(Connection: mysql, SQL: update `products` set `auditEvents` = ?, `products`.`updated_at` = 2024-04-17 10:53:00 where `id` = 2123)

Indeed, I don't have that column on the products table, but it doesn't say in the documentation that I should update all the tables to add new columns to them.

class Product extends Model implements ProductContract, Auditable {
    use \OwenIt\Auditing\Auditable;

  .....
}

Later edit:
I added auditEvents inside my model and now I didn't receive any error but the audits table it's still empty.

public $auditEvents = [
    'created',
    'updated'
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions