Hi i am working for one project in laravel 5 and i was with dificult in my authentication login. When i try put my credentials at login never logs and redirect again for the page "login" and never for the page that i want. My table in phpmyadmin called "users" so the use Auth is right. I don't understand because doesn't work. If anyone help me i apreciate alot.
<?php namespace App\Http\Controllers;
use Auth;
// product é a pasta e o index é a pagina
class BackendControlador extends Controller {
public function index() {
$email = 'email';
$password = 'password';
if (Auth::attempt(['email' => $email, 'password' => $password, 'acesso' => 1])) {
return redirect()->intended('backend/dashboard.index');
} elseif (Auth::attempt(['email'=> $email, 'password' => $password, 'acesso' => 0])) {
return redirect()->intended('welcome');
} else {
return view('auth/login');
}
}
public function portfolio() {
return view('backend/portfolio.index');
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire