1
I have an admin who is already logging in correctly, I have the logout function done but this giving the following error: when I logout says that there is no column remember_token
on my table.
How can I fix this? Because I created 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');
}
}
Tried to create this attribute
remember_token
on your table?– Felipe Paetzold