Search code examples
laraveltokenlogout

Laravel logout remember token error


This time I'm trying to do logout user... I'm pretty sure that my routing and controllers are good, but I don't know why I have error looks like this ( of course when I'm trying to logout ):

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'remember_token' in 'field list' 

This is my method in controller :

public function logout()
{
    Auth::logout();
    return redirect('/');
}

My logout is a link in view... What is wrong?


Solution

  • For logout to work in laravel you should add remember_token column in your users table. or whatever table you are using for auth