getEntityManager()->createQueryBuilder() ->select("c") ->from(\App\Models\ResourceServer\EndPointRateLimitByIP::class, "c") ->where('c.route = :route') ->andWhere('c.http_method = :http_method') ->andWhere('c.ip = :ip') ->andWhere('c.active = 1') ->setParameter('ip', trim($ip)) ->setParameter('route', trim($route)) ->setParameter('http_method', trim($http_method)) ->getQuery() ->getOneOrNullResult(); } catch(\Exception $ex){ Log::error($ex); return null; } } }