Personally I changed the default model name of Laravel User.php
to Colaboradores.php
(of course, I set the $table
and $primaryKey
in the model), I also changed the config/auth.php
to model
. but login is always returning me false
, follow login code:
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => Siga\Colaboradores::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
public function auth( Request $request )
{
$username = $request->input("usuario_colaborador");
$password = $request->input("senha_colaborador");
if( Auth::check() || Auth::attempt([
'usuario_colaborador' => $username,
'senha_colaborador' => $password]) )
{
// redirecionando usuário depois de logado
return redirect(route('farol.meufarol'));
}
else
return redirect(route('login'));
}