I have an admin that is already logging in correctly, I have the logout function done but it gives the following error: when I log out it says that there is no column remember_token
in my table.
How can I resolve this? Because I created the custom tables.
Controller
namespace App\Http\Controllers\admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\User;
use DB;
use Auth;
use Redirect;
use Hash;
use Illuminate\Support\Facades\Input;
class LoginController extends Controller
{
public function showLogin ()
{
if (Auth::check()){
return Redirect::to('/admin');
}
return view('admin/login');
}
public function postLogin()
{
$username = Input::get('username');
$passwd = Input::get('password');
$user = User::where('username', $username)->first();
if ($user && Hash::check($passwd, $user->passwd)) {
Auth::login($user);
return Redirect::intended('admin');
}
return Redirect::back()->with('error_message', 'Dados Incorrectos')->withInput();
}
public function logOut()
{
Auth::logout();
return Redirect::to('admin/login')->with('error_message', 'Logged out correctly');
}
}