Skip to content

Commit

Permalink
support pulling rate limit from the user instance
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 26, 2018
1 parent c919402 commit c9e6100
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Routing/Middleware/ThrottleRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ protected function resolveMaxAttempts($request, $maxAttempts)
$maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0];
}

if (! is_numeric($maxAttempts) && $request->user()) {
$maxAttempts = $request->user()->{$maxAttempts};
}

return (int) $maxAttempts;
}

Expand Down

0 comments on commit c9e6100

Please sign in to comment.