<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
protected $table='administrador';
public $timestamps=false;
public function showLoginForm()
{
return view('auth.login');
}
protected function Login(Request $request)
{
if(Auth::attempt(["email"=>$request->get('email'),"password"=>$request->get('password')])){
return Redirect::to('home');
} else{
}
}
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = 'administracion/reportes/general';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
When I try to change the table for authentication, problems appear.
I have detected that attempt returns true, at the time of addressing the page, it returns me to the login, I do not know why, when it should send me to the home page.
This is the home controller code
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('home');
}
}
This is the ROUTE
Route::get('home', 'HomeController@index')->name('home');