<?php namespace consulta\Http\Controllers;
use consulta\Http\Requests;
use consulta\Http\Controllers\Controller;
//use consulta\Http\Controllers\Controller;
use consulta\Myusers1;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use DB;
use consulta\Myusers1;
class LoginController extends Controller {
//Formulário de login
public function form(){
return view ('form_login');
}
//verifica a existência no banco
public function login(Request $req){
$mat = $req->input('matricula');
$senha = Hash::make($req->input('senha'));
var_dump($senha);
$check = DB::table('users')->where(['matricula'=>$mat])->get();
if (Hash::check($check[0]->senha, $senha)); // true
if ($check )
{
return 'ok';
}
return 'nao ok';
}
}