Files
cachet-docker/app/filters/LoginThrottlingFilter.php
2015-01-01 15:58:24 +00:00

17 lines
467 B
PHP

<?php
use GrahamCampbell\Throttle\Facades\Throttle;
class LoginThrottlingFilter
{
public function filter($route, $request)
{
// check if we've reached the rate limit, but don't hit the throttle yet
// we can hit the throttle later on in the if validation passes
if (!Throttle::check($request, 10, 10)) {
return Redirect::back()
->with('error', 'You have made too many login requests.');
}
}
}