ardent
ardent copied to clipboard
Ardent + Laravel 4.1.28 User model doesn't update remember_token
Hi,
i use the latest Laravel release with ardent. My User model extends Ardent and have some basic rules.
In the latest version of Laravel there is a new column "remember_token" which not gets updated with Ardent, because Eloquent uses the models save() method to update the auth token.
How this can be fixed? Any ideas? :)
Here my workaround:
Insert
User::$rules = array();
before Auth::attempt() in the AuthController so Laravel can use the save() method to update the remember_token.
Cheers! :)
Hey, thanks for the quick & dirty fix, I happened to stumble upon it right after you posted it :)
I just wanted to note that you also should do that before Auth::logout(), otherwise the remember_me cookie will remain valid.
Thanks @lan0 updatingmycontroller
But if SomeModel::rules contains an unique rule,whenever you use somemodel->save() to update the model,it will throw a exception.(Seem to be #86 just can fix it in someway.) Must I use somemodel->UpdateUnique() to avoid it?
+1 this. Saved so much hair pulling.
This is a terrible hack but it still works. Thank you.