Tenho um admin em que já esta a fazer login correctamente, tenho na função fazer logout feita mas esta a dar o seguinte erro: quando facofaço logout diz que não existe a coluna remember_tokenremember_token
na minha tabela como.
Como posso resolver isto pois? Pois eu criei as tabelas personalizadas ?.
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');
}
}
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');
}
}