0
How to authenticate the user login and password in Windows, I’ve been trying for a while but I can’t.
Routes
Route::get('/login',['uses' => 'loginController@login','as' => 'login']);
Route::post('/login',['uses'=>'loginController@checkLogin','as' => 'VerificarLogin']);
My controller
class loginController extends Controller
{
public function login(){
return view('Inicial.login');
}
public function teste(){
return view('teste');
}
public function checkLogin(Request $request ){
$email = Input::get('email');
$password = Input::get('password');
if (Auth::attempt(['email' => $email, 'password' => $password])) {
return 1;
}
return 0;
}
My auth.php file
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'table' => 'usuarios',
'model' => App\Usuario::class,
],
My User class
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Usuario extends Authenticatable
{
protected $fillable = ['nome','password','email','data_nascimento','rg','funcao','telefone'];
protected $table = 'usuarios';
}`
And my personal form
<form class="form-horizontal new-lg-form" id="loginform" action="{{ route('VerificarLogin') }}" method="post">
{{ csrf_field() }}
<div class="form-group m-t-20">
<div class="col-xs-12">
<label>Endereço de Email</label>
<input class="form-control" type="text" required="" placeholder="Email" id="email" name="email">
</div>
</div>
<div class="form-group">
<div class="col-xs-12">
<label>Senha</label>
<input class="form-control" type="password" required="" placeholder="Senha" id="senha" name="password">
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<div class="checkbox checkbox-info pull-left p-t-0">
<input id="checkbox-signup" type="checkbox">
<label for="checkbox-signup"> Lembrar-me </label>
</div>
<a href="javascript:void(0)" id="to-recover" class="text-dark pull-right"><i class="fa fa-lock m-r-5"></i> Esqueceu a senha ?</a> </div>
</div>
<div class="form-group text-center m-t-20">
<div class="col-xs-12">
<button class="btn btn-info btn-lg btn-block btn-rounded text-uppercase waves-effect waves-light" type="submit">Entrar</button>
</div>
</div>
</form>
On my check I can never log in or log in. If someone has a similar project send the link for me to look at or download
vlw man helped yes ^^
– Joan Marcos