How to restrict the flow of api interface (not for ip, and users) and how to implement nerd


As the topic is.
The interface limits the access times of the same user (device)

Since the label of the problem is “inside”Laravel, then the ready-made solution, I recommend, package has a featureRate Limiting, should be what you are looking for.

If you want to implement it yourself, it is also simple to use [user_id plus unique device code] as the primary key, save the access times in redis, record the access times, and then the specific frequency and number will depend on your implementation strategy.