I'm not sure if this works but you can try :)
// Routes
Session::put("wrongLogin", "0");
Route::get("/", function()
{
return View::make("login")->with("wrongLogin", Session::get("wrongLogin"));
});
Route::post("/", function()
{
$username = Input::get("username");
$password = Input::get("password");
$login = array("username" => $username, "password" => $password);
if(Auth::attempt($login))
{
// show user link (logout, edit profile etc)
} else {
Sessions::put("wrongLogin", (Session::get("wrongLogin") + 1));
return View::make("login")->with("wrongLogin", Session::get("wrongLogin"));
}
});
// View
@if($wrongLogin == 3)
Login is blocked
@else
Login form
@endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community