Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public static function isFlooding(User $user, string $rule = 'xetaravel.flood.general'): bool |
||
18 | { |
||
19 | $class = get_called_class(); |
||
20 | |||
21 | return $class::where('user_id', $user->id) |
||
22 | ->where( |
||
23 | 'created_at', |
||
24 | '>=', |
||
25 | Carbon::now()->subSeconds(config($rule)) |
||
26 | ) |
||
27 | ->exists(); |
||
28 | } |
||
29 | } |
||
30 |