Skip to content

Commit c9e6100

Browse files
committed
support pulling rate limit from the user instance
1 parent c919402 commit c9e6100

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Routing/Middleware/ThrottleRequests.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ protected function resolveMaxAttempts($request, $maxAttempts)
7575
$maxAttempts = explode('|', $maxAttempts, 2)[$request->user() ? 1 : 0];
7676
}
7777

78+
if (! is_numeric($maxAttempts) && $request->user()) {
79+
$maxAttempts = $request->user()->{$maxAttempts};
80+
}
81+
7882
return (int) $maxAttempts;
7983
}
8084

0 commit comments

Comments
 (0)