Skip to content

retrieved is firing, but I don't have it at my events array #778

Answered by dhcmega
dhcmega asked this question in Q&A
Discussion options

You must be logged in to vote

When I run a query over a model, Auditable is looking for an attribute of the model: $auditEvents
This variable is optional, if the model doesn't have it, Metable kicks in and tries to get it from the meta table. This has haunted me for more than 2 years, glad I finally figured it out.

Adding this to model solves it:

    public $auditEvents = [
        0 => "created",
        1 => "updated",
        2 => "deleted",
        3 => "restored",
    ];

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by parallels999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #537 on March 13, 2023 20:37.