File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/UserInterface/Components Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 55namespace ARKEcosystem \Foundation \UserInterface \Components ;
66
77use ARKEcosystem \Foundation \UserInterface \Components \Concerns \HandleToast ;
8+ use Carbon \Carbon ;
89use DanHarrin \LivewireRateLimiting \Exceptions \TooManyRequestsException ;
910use DanHarrin \LivewireRateLimiting \WithRateLimiting ;
1011use Illuminate \Support \Facades \RateLimiter ;
@@ -31,10 +32,11 @@ final protected function getThrottlingAvailableIn(): string
3132
3233 $ secondsUntilAvailable = RateLimiter::availableIn ($ this ->getRateLimitKey ($ throttlingKey ));
3334
34- $ parts = explode ( ' : ' , gmdate ( ' H:i ' , $ secondsUntilAvailable ));
35+ $ diff = Carbon:: createFromTimeStamp ( $ secondsUntilAvailable)-> diff (Carbon:: createFromTimeStamp ( 0 ));
3536
36- $ hours = (int ) $ parts [0 ];
37- $ minutes = (int ) $ parts [1 ];
37+ $ hours = $ diff ->h + ($ diff ->d * 24 );
38+ $ minutes = $ diff ->i ;
39+ $ seconds = $ diff ->s ;
3840
3941 if ($ hours > 0 ) {
4042 if ($ minutes > 0 ) {
You can’t perform that action at this time.
0 commit comments