<?php
 namespace TechOnline\Laravel\RateLimit; use Illuminate\Support\Facades\Log; abstract class AbstractRateLimiter { public function hit($key, $limit, $window) { throw new \Exception('must override hit method'); } public function permit($key, $limit, $window) { try { $ret = $this->hit($key, $limit, $window); if (null == $ret) { return true; } return !$ret['over']; } catch (\Exception $e) { Log::info("RateLimiter.ERROR -> " . $e->getMessage()); } return true; } }