Im trying to do Auth:logout();
, but im getting this error. Do i really need this column or i can avoid that?
Route::get('/logout', 'MainController@logout');
public function logout(){
Auth::logout();
return response()->json([
'isLoggedIn' => false
]);
}
Looks like you've deleted the remember_token
from the users
table. Laravel uses this field by default, so you can just add the field back to the table:
$table->rememberToken();
Of course you could override some of Laravel methods to disable this functionality, but I wouldn't recommend that.
You could avoid that by using this on your User Model.
/**
* Overrides the method to ignore the remember token.
*/
public function setAttribute($key, $value)
{
$isRememberTokenAttribute = $key == $this->getRememberTokenName();
if (!$isRememberTokenAttribute)
{
parent::setAttribute($key, $value);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With