Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Create not logged #43

Open
sasuandrei opened this issue Jan 6, 2023 · 2 comments
Open

On Create not logged #43

sasuandrei opened this issue Jan 6, 2023 · 2 comments

Comments

@sasuandrei
Copy link

Hello,
I've changed the user-activity.php file for on_create to true but in log list all the data created it's not logged.

 'log_events' => [
        'on_create'     => true,
        'on_edit'       => true,
        'on_delete'     => true,
        'on_login'      => true,
        'on_lockout'    => true
    ]

image

Only log-in or edit are logged.
What can I do to log what is created?
Thank you

@jdevfullstack
Copy link

good day, @haruncpi

first of all, I want to thank you for this awesome project, it really helps a lot

it's working both for web & API requests but one problem is same here, some tables are logging both create and edit but some tables don't, the features are also enabled in the general setting like this situation

in my case, one specific table will only log create but not edit

maybe to solve this is to ask, how does the package know the log_type and how it is being triggered, so we can track what's causing the issue

@sasuandrei , did you find any solution to this ? thanks

@jdevfullstack
Copy link

jdevfullstack commented Sep 26, 2023

hello there @haruncpi @sasuandrei , finally pinned down the problem

it's the way it's being triggered, by calling Eloquent findOrFail instead of using Laravel Query Builder where

image

this can be applicable in other scenarios too, when even if the settings are correct, it will still fail to log

@haruncpi , maybe I should submit a PR mentioning this on your README ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants