Is it safe to use the remember_token
in the users table for authenticating the user into the application?
What is the purpose of this token? Currently, I\'m
Even if this an old question, I wanted to present an option not use the token if you don't need it (e.g. have no remember me option on your site).
Instead of adding a dummy column to your users table you can just prevent Auth::logout() from setting it.
Just add this to your User model (works as of Laravel 5.6):
public function save(array $options = array()) {
if(isset($this->remember_token))
unset($this->remember_token);
return parent::save($options);
}
This removes the 'remember_token' column just before the model gets saved and thus preventing an error to be risen because of the non-existant column.