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