Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

squibby's avatar

How to disable remember_me update / or stop remember_me token updates showing in dirty model events

I am logging model events. In this case when a user is created , updated or deleted.

When a model event is fired I log the action to an audit table along with the changed data using the $this->getDirty() method.

This is working mostly ok for me, except when I log in, the remember_me token in the the User table is being updated and causing an update event.

I don't want to log an updated user log entry everytime I log in because of this.

I have tried removing the remember_token from the table and this fixes the problem, but then when I log out laravel is squawking about the remember_token.

I am not actually making use of the remember_token on my login page anyway.

Is there any way i can either.. disable it, stop it updating eveytime anyone logs in, or... customize which updated fields are excluded from the model getDirty() information.

Hope my problem makes sense to someone.

Thanks for looking.

0 likes
1 reply
jekinney's avatar
jekinney
Best Answer
Level 47

In your logging check if the dirty remember me = current remember me. If not don't log. If it does they updated something else.

Please or to participate in this conversation.